public void Run(IPAddress address, int port)
 {
     try{
         _TCPClient = new TCPClient(address, port);
         _TCPClient.Connect();
         _TCPClient.RecieveDataEvent += RecieveResponse;
     }catch (SocketException) {
         _TCPClient.Dispose();
         throw new CRClientException("Cant connect to server with this ip:" + address.ToString());
     }
     catch (TCPProtocolException exc)
     {
         _TCPClient.Dispose();
         throw new CRClientException("Cant connect to server with this ip:" + address.ToString(), exc);
     }
 }
 public ScreenshotController(ITCPClient client, IOptions <DataOfServer> options)
 {
     dataOfServer = options.Value;
     tcpClient    = client;
     tcpClient.Connect(dataOfServer.Ip, dataOfServer.Port);
 }
Esempio n. 3
0
 public void StartCommandsChannel()
 {
     client = MyTCPClient.Instance;
     client.Connect();
 }