private UvTcpHandle ListenTcp(bool useFileHandle) { var socket = new UvTcpHandle(Log); try { socket.Init(Thread.Loop, Thread.QueueCloseHandle); socket.NoDelay(EndPointInformation.NoDelay); if (!useFileHandle) { socket.Bind(EndPointInformation.IPEndPoint); // If requested port was "0", replace with assigned dynamic port. EndPointInformation.IPEndPoint = socket.GetSockIPEndPoint(); } else { socket.Open((IntPtr)EndPointInformation.FileHandle); } } catch { socket.Dispose(); throw; } return(socket); }
private UvTcpHandle CreateAcceptSocket() { var socket = new UvTcpHandle(Log); try { socket.Init(_thread.Loop, _thread.QueueCloseHandle); socket.NoDelay(true); } catch { socket.Dispose(); throw; } return(socket); }
private UvTcpHandle AcceptTcp() { var socket = new UvTcpHandle(Log); try { socket.Init(Thread.Loop, Thread.QueueCloseHandle); socket.NoDelay(EndPointInformation.NoDelay); } catch { socket.Dispose(); throw; } return(socket); }