/** * Send the login message through the socket to the server */ public void SendLoginMessage() { LoginMessage nameMsg = new LoginMessage(); nameMsg.SetName(ClientName); nameMsg.SetPassword(ClientPassword, Salt); MemoryStream outStream = nameMsg.WriteData(Salt); try { clientSocket.Send(outStream.ToArray()); ClientPassword = ""; } catch (Exception ex) { Console.WriteLine("Error sending message: " + ex); } }