tidwall / evio

Fast event-loop networking for Go
MIT License
5.9k stars 492 forks source link

Writing to UDP #36

Closed ghost closed 5 years ago

ghost commented 5 years ago

Is this still the case?

https://github.com/tidwall/evio/issues/19

tidwall commented 5 years ago

You can write to UDP when the Data event fires by returning bytes to the output. Calling Wake will force a Data to fire and should allow for arbitrary writes to the UDP connection.

ghost commented 5 years ago

Thanks for the quick response :). Is this quite stable and ready for production?

Also in terms of multi threading, do we need to use locks etc to access data across different events?

tidwall commented 5 years ago

Evio is production ready. Yes, If you use multithreading then you should use locks for shared data.