public FileSender(string ipAddress, int port, string fileName) { _fileName = fileName; _tcpClient = new TcpClient(new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)); _tcpClient.Connect(ipAddress, port); SendingFileToServer(); //Console.CancelKeyPress += KeyPressHanlder; _tcpClient.EndConnection(); }