예제 #1
0
 internal string Receive()
 {
     byte[] bytes;
     while (true)
     {
         try
         {
             bytes = receiver.Receive(ref blankEP);
             break;
         }
         catch (SocketException e)
         {
         }
     }
     return(Encoding.ASCII.GetString(HammingEncoder.DecodeBits(bytes)));
 }
예제 #2
0
 internal void Send(string message)
 {
     byte[] messageBytes = HammingEncoder.EncodeBits(Encoding.ASCII.GetBytes(message));
     sender.Send(messageBytes, messageBytes.Length);
 }
예제 #3
0
 internal string Receive(ref IPEndPoint tempEP)
 {
     return(Encoding.ASCII.GetString(HammingEncoder.DecodeBits(receiver.Receive(ref tempEP))));
 }