lidgren-network-gen3
lidgren-network-gen3 copied to clipboard
[QUESTION] Thread safety
I wonder, is Lidgren safe to use in multiple threads? I plan on having multiple hosts on my program, and I'm wondering if its possible with multiple threads. Also, is it possible that multiple threads can access the same host? Do I need to add something more to make it thread-safe, or is it already thread-safe?
It is all ready thread safe 👍
Sounds good. Also, does lidgren support multiple hosts/servers per program?
I assume so as it's not a singleton, might have to experiment though
ah, will do later
Yes, multiple NetPeer
s works just fine in the same process (as long as you bind them to a different host:port pair, of course). I'm using it to implement dual stack IPv6 (because I didn't know what dual stack sockets were at the time, but I guess it provides compat with stuff like OpenBSD so yay?).