Пример #1
0
 public void RaiseMessageReceived(Message message, IPEndPoint endpoint)
 {
     DhtEngine.MainLoop.Queue(delegate
     {
         OnMessageReceived(message.Encode(), endpoint);
     });
 }
Пример #2
0
 private void Compare(Message m, string expected)
 {
     byte[] b = m.Encode();
     Assert.AreEqual(Encoding.UTF8.GetString(b), expected);
 }
Пример #3
0
 private void SendMessage(Message message, IPEndPoint endpoint)
 {
     lastSent = DateTime.Now;
     byte[] buffer = message.Encode();
     listener.Send(buffer, endpoint);
 }
Пример #4
0
 private void SendMessage(Message message, IPEndPoint endpoint)
 {
     lastSent = Environment.TickCount;
     byte[] buffer = message.Encode();
     listener.Send(buffer, endpoint);
 }