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); }
public void StartCommandsChannel() { client = MyTCPClient.Instance; client.Connect(); }