Пример #1
0
 void ConnectAsync()
 {
     tcpClient                   = SocketConnector.Connect(Settings.GetEndpoint(), Settings.ConnectTimeout);
     tcpClient.SendTimeout       = Settings.ConnectTimeout;
     tcpClient.SendBufferSize    = Settings.SendBufferSize;
     tcpClient.ReceiveBufferSize = Settings.ReceiveBufferSize;
 }
Пример #2
0
        TCP.TcpClient ConnectAsync()
        {
            var tcpClient = SocketConnector.Connect(GetEndpoint(), ConnectTimeout);

            tcpClient.SendTimeout       = ConnectTimeout;
            tcpClient.SendBufferSize    = SendBufferSize;
            tcpClient.ReceiveBufferSize = ReceiveBufferSize;
            if (tcpClient.Connected)
            {
                return(tcpClient);
            }
            else
            {
                return(null);
            }
        }