public void Dispose() { _networkStream = null; _receiver = null; _sender = null; _tcpServer.Close(); }
public ClientTCP(string ipAddress, int port) { _tcpServer = new TcpClient(ipAddress, port); _data = new byte[1024]; _networkStream = _tcpServer.GetStream(); _receiver = new Receiver(_networkStream); _sender = new Sender(_networkStream); _receiver.DataReceived += OnDataReceived; }