Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Thread safety #141

Open
iProgramMC opened this issue Jun 22, 2020 · 5 comments
Open

[QUESTION] Thread safety #141

iProgramMC opened this issue Jun 22, 2020 · 5 comments

Comments

@iProgramMC
Copy link

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?

@guerrillacontra
Copy link

It is all ready thread safe 👍

@iProgramMC
Copy link
Author

Sounds good. Also, does lidgren support multiple hosts/servers per program?

@guerrillacontra
Copy link

guerrillacontra commented Jul 31, 2020

I assume so as it's not a singleton, might have to experiment though

@iProgramMC
Copy link
Author

ah, will do later

@PJB3005
Copy link
Contributor

PJB3005 commented Aug 2, 2020

Yes, multiple NetPeers 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?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants