KestrelHttpServer icon indicating copy to clipboard operation
KestrelHttpServer copied to clipboard

Kestrel as TcpListener

Open ru-sh opened this issue 10 years ago • 5 comments

Hello! It is possible to use kestrel server as a simple TcpListener? If possible, any example, please.

ru-sh avatar Jan 03 '16 11:01 ru-sh

You'd be better off using something like libuvsharp or copying the appropriate classes from kestrel

davidfowl avatar Jan 03 '16 12:01 davidfowl

Why would you like to do that?

cesarblum avatar Jan 08 '16 04:01 cesarblum

I need to start TcpListener in CoreClr runtime. As far as I know, cross-platform implementation of TcpListener today exists only in Kestrel.

ru-sh avatar Jan 08 '16 08:01 ru-sh

Still, Kestrel isn't a TcpListener, it's a webserver. I'd file an issue like this on CoreFX, or just use the socket APIs on .NET Core. Those work cross platform as well.

davidfowl avatar Jan 08 '16 08:01 davidfowl

As @davidfowl suggested, you could copy the relevant classes from Kestrel, or use sockets. We don't have any plans to separate out the listener part of Kestrel, so I'm closing this issue.

cesarblum avatar Jan 08 '16 18:01 cesarblum