Beispiel #1
0
 protected virtual void OnReceive(UdpReceiveArgs e)
 {
     if (Receive != null)
     {
         Receive(this, e);
     }
 }
Beispiel #2
0
 private void OnReceiveCompleted(object sender, SocketAsyncEventArgs e)
 {
     try
     {
         if (e.SocketError == SocketError.Success && e.BytesTransferred > 0)
         {
             UdpReceiveArgs ura = new UdpReceiveArgs();
             ura.EndPoint = e.RemoteEndPoint;
             ura.Data     = e.Buffer;
             ura.Offset   = 0;
             ura.Count    = e.BytesTransferred;
             OnReceive(ura);
         }
     }
     catch (Exception e_)
     {
         mLastError = e_;
     }
     finally
     {
         Push(e);
     }
 }
Beispiel #3
0
 private void OnReceiveCompleted(object sender, SocketAsyncEventArgs e)
 {
     try
     {
         if (e.SocketError == SocketError.Success && e.BytesTransferred > 0)
         {
             UdpReceiveArgs ura = new UdpReceiveArgs();
             ura.EndPoint = e.RemoteEndPoint;
             ura.Data = e.Buffer;
             ura.Offset = 0;
             ura.Count = e.BytesTransferred;
             OnReceive(ura);
         }
     }
     catch (Exception e_)
     {
         mLastError = e_;
     }
     finally
     {
         Push(e);
     }
 }
Beispiel #4
0
 protected virtual void OnReceive(UdpReceiveArgs e)
 {
     if (Receive != null)
         Receive(this, e);
 }