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);
     }
 }
Пример #2
0
 public ScreenshotController(ITCPClient client, IOptions <DataOfServer> options)
 {
     dataOfServer = options.Value;
     tcpClient    = client;
     tcpClient.Connect(dataOfServer.Ip, dataOfServer.Port);
 }
Пример #3
0
 public void StartCommandsChannel()
 {
     client = MyTCPClient.Instance;
     client.Connect();
 }