CreateSocketHandler() private method

private CreateSocketHandler ( Socket socket, String machineAndPort ) : SocketHandler
socket System.Net.Sockets.Socket
machineAndPort String
return SocketHandler
        private SocketHandler CreateNewSocket(EndPoint ipEndPoint)
        {
            Socket socket = new Socket(ipEndPoint.AddressFamily,
                                       SocketType.Stream,
                                       ProtocolType.Tcp);

            DisableNagleDelays(socket);
            InternalRemotingServices.RemotingTrace("RemoteConnection::CreateNewSocket: connecting new socket :: " + ipEndPoint);

            socket.Connect(ipEndPoint);
            _lkgIPEndPoint = socket.RemoteEndPoint;
            return(_socketCache.CreateSocketHandler(socket, _machineAndPort));
        } // CreateNewSocket
Beispiel #2
0
        } // ReleaseSocket

        private SocketHandler CreateNewSocket()
        {
            Socket socket = new Socket(AddressFamily.InterNetwork,
                                       SocketType.Stream,
                                       ProtocolType.Tcp);

            // disable nagle delays
            socket.SetSocketOption(SocketOptionLevel.Tcp,
                                   SocketOptionName.NoDelay,
                                   1);

            InternalRemotingServices.RemotingTrace("RemoteConnection::CreateNewSocket: connecting new socket :: " + _ipEndPoint);

            socket.Connect(_ipEndPoint);

            return(_socketCache.CreateSocketHandler(socket, _machineAndPort));
        } // CreateNewSocket