public void SendLine(string message) { if (Connected) { byte[] byData = System.Text.Encoding.ASCII.GetBytes(message + "\n"); _TCPSocket.Send(byData); } else { throw new InvalidOperationException("socket is not connected"); } }