Unity cant have multiple servers hosting at once on linux
So i have a master server on linux and when a player requests a lobby it starts a server host to have that player and anyone who wants to connect to him play the game. the server manager calls lobbyManager.StartHost() and the server host calls lobbyManager.StartServer(). on linux i start the server manager and everything works fine but when i start the server host while the server manager is still running it gives me this error Unhandled exeption: System.Net.Sockets.SocketExeption: Address already in use at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 at System.Net.Sockets.TcpListener.Start (Int32 backlog) [0x00000] in <filename unknown>:0 at System.Net.Sockets.TcpListener.Start () [0x00000] in <filename unknown>:0 at GameStartedServer.BackgroundStart () [0x00000] in <filename unknown>:0
i dont have this problem on windows only on linux so i looked around and found this it says that its a problem with linux and a work around they found was to do server.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true)
before starting the server. but what i need help with is i need to know how to call that function in unity. Because all i do is call StartServer or StartHost i don't have access to the socket so i cant call SetSocketOption
Your answer
![](https://koobas.hobune.stream/wayback/20220612163226im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Executable published for Linux are very slow to start 0 Answers
Linux Ubuntu 16.04 - Unhandled Exception: System.ExecutionEngineException: SIGILL - Androidbuild 0 Answers
Can I run C# scripts from Unity on an Ubuntu 19.10 macine? Huge stack of compiling errors. 0 Answers
Huge stack of compiling errors. Can C# scripts be ran through Unity on Ubuntu 19.10 systems? 0 Answers