We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b692bf commit 39e76baCopy full SHA for 39e76ba
easysocket/src/tcpserver.cpp
@@ -2,6 +2,9 @@
2
3
TCPServer::TCPServer(std::function<void(int, std::string)> onError) : BaseSocket(onError, TCP)
4
{
5
+ int opt = 1;
6
+ setsockopt(this->sock,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(int));
7
+ setsockopt(this->sock,SOL_SOCKET,SO_REUSEPORT,&opt,sizeof(int));
8
}
9
10
void TCPServer::Bind(int port, std::function<void(int, std::string)> onError)
0 commit comments