mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
ReuseAddress requires Socket level
This commit is contained in:
parent
cc5c86091e
commit
a0a53ff7bf
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ public class Server {
|
|||
|
||||
public async Task Listen(CancellationToken? token = null) {
|
||||
Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
serverSocket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.ReuseAddress, true);
|
||||
serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
|
||||
serverSocket.Bind(new IPEndPoint(IPAddress.Parse(Settings.Instance.Server.Address), Settings.Instance.Server.Port));
|
||||
serverSocket.Listen();
|
||||
|
||||
|
|
Loading…
Reference in a new issue