Connect() public method

public Connect ( IPAddress ip, int port ) : void
ip System.Net.IPAddress
port int
return void
Beispiel #1
0
 public void Connect(IPAddress ip, int port)
 {
     var client = new TcpClientSocket();
     client.OnConnect += onConnected;
     client.Connect(ip, port);
     socket = client;
 }
Beispiel #2
0
        public void Connect(IPAddress ip, int port)
        {
            var client = new TcpClientSocket();

            client.OnConnect += onConnected;
            client.Connect(ip, port);
            socket = client;
        }
Beispiel #3
0
 static void initClient(string[] args)
 {
     IPAddress ip = null;
     int port = 0;
     try {
         ip = IPAddress.Parse(args[1]);
         port = int.Parse(args[2]);
         var client = new TcpClientSocket();
         client.OnDisconnect += onDisconnect;
         client.Connect(ip, port);
         _socket = client;
         start();
     } catch (Exception) {
         Console.WriteLine("Please specify a valid ip and port");
     }
 }