Set TCP_NODELAY on connections (#5558)
* Set TCP_NODELAY on connections Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk> * Windows wants a char * not a void * :-( Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk> * And clang objects to old style casts Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk> --------- Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
This commit is contained in:
parent
64e97c8d16
commit
a66a67c2ab
@ -98,6 +98,7 @@
|
|||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -328,6 +328,9 @@ void cServerHandleImpl::Callback(evconnlistener * a_Listener, evutil_socket_t a_
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int one = 1;
|
||||||
|
setsockopt(a_Socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char *>(&one), sizeof(one));
|
||||||
|
|
||||||
// Create a new cTCPLink for the incoming connection:
|
// Create a new cTCPLink for the incoming connection:
|
||||||
cTCPLinkImplPtr Link = std::make_shared<cTCPLinkImpl>(a_Socket, LinkCallbacks, Self->m_SelfPtr, a_Addr, static_cast<socklen_t>(a_Len));
|
cTCPLinkImplPtr Link = std::make_shared<cTCPLinkImpl>(a_Socket, LinkCallbacks, Self->m_SelfPtr, a_Addr, static_cast<socklen_t>(a_Len));
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user