NLog.TcpClientSocket.Connect C# (CSharp) Method

Connect() public method

public Connect ( IPAddress ip, int port ) : void
ip System.Net.IPAddress
port int
return void
        public void Connect(IPAddress ip, int port)
        {
            _log.Debug(string.Format("Connecting to {0}:{1}...", ip, port));
            _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            _socket.BeginConnect(ip, port, onConnected, _socket);
        }

Usage Example

Exemplo n.º 1
0
 public void Connect(IPAddress ip, int port)
 {
     var client = new TcpClientSocket();
     client.OnConnect += onConnected;
     client.Connect(ip, port);
     socket = client;
 }
All Usage Examples Of NLog.TcpClientSocket::Connect