Exemple #1
0
 public void SendMessage(PeerMessage message)
 {
     if (Client.Connected)
     {
         NetworkStream nwStream    = Client.GetStream();
         byte[]        bytesToSend = ASCIIEncoding.ASCII.GetBytes("||" + message.ToJSON());
         //---send the text---
         nwStream.Write(bytesToSend, 0, bytesToSend.Length);
         nwStream.Flush();
     }
 }
Exemple #2
0
 public void HandlePeerMessage(PeerMessage message)
 {
     Console.WriteLine($"Message Recieved: {message.ToJSON()}");
 }