/// <summary> /// Creates a socket which can be used to accept an incoming connection /// </summary> protected override UvStreamHandle CreateAcceptSocket() { var acceptSocket = new UvTcpHandle(); acceptSocket.Init(Thread.Loop, Thread.QueueCloseHandle); acceptSocket.NoDelay(true); acceptSocket.KeepAlive(true); return(acceptSocket); }
/// <summary> /// Handle an incoming connection /// </summary> /// <param name="listenSocket">Socket being used to listen on</param> /// <param name="status">Connection status</param> protected override void OnConnection(UvStreamHandle listenSocket, int status) { var acceptSocket = new UvTcpHandle(); try { acceptSocket.Init(Thread.Loop, Thread.QueueCloseHandle); acceptSocket.NoDelay(true); acceptSocket.KeepAlive(true); listenSocket.Accept(acceptSocket); DispatchConnection(acceptSocket); } catch (UvException) { //Service.Logger.Log(ex); acceptSocket.Dispose(); return; } }
public void KeepAlive(uint delay) { UvTcpHandle.KeepAlive(delay); }