evio icon indicating copy to clipboard operation
evio copied to clipboard

Serve from a specific net.PacketConn

Open ilyaglow opened this issue 5 years ago • 4 comments

Hey there,

What do you think about adding a function that can serve events from a specified net.PacketConn or do you have a will to accept a PR with this feature?

ilyaglow avatar Apr 23 '19 19:04 ilyaglow

Here is my try: https://github.com/ilyaglow/evio/blob/master/evio.go#L196

ilyaglow avatar Apr 24 '19 14:04 ilyaglow

https://github.com/tidwall/evio/blob/master/evio.go#L162 ?

ghost avatar Sep 10 '19 12:09 ghost

The thing is that I need to use my net.PacketConn in multiple places and not stick it for evio only. I have an app that sends a lot of packets through UDP socket and evio simply process replies.

ilyaglow avatar Sep 10 '19 14:09 ilyaglow

hm, looks like there should be no issue with this. i use the same approach for http/grpc servers where i handle tls on the listener and not in the server, for example. but in this case the serve() method is private so you have to fork it :(

ghost avatar Sep 10 '19 18:09 ghost