protected virtual void OnReceive(UdpReceiveArgs e) { if (Receive != null) { Receive(this, e); } }
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); } }
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); } }
protected virtual void OnReceive(UdpReceiveArgs e) { if (Receive != null) Receive(this, e); }