예제 #1
0
파일: UdpSession.cs 프로젝트: tommybiteme/X
 void Udp_Received(object sender, NetEventArgs e)
 {
     // 判断是否当前远程地址
     if (!Connected)
     {
         // 如果不是当前远程地址,则不触发已收到事件
         if (e.RemoteEndPoint + "" != RemoteEndPoint + "") return;
     }
     if (Received != null) Received(this, new ReceivedEventArgs(e.GetStream()));
 }
예제 #2
0
파일: TcpClientX.cs 프로젝트: tommybiteme/X
 void TcpClientX_Received(object sender, NetEventArgs e)
 {
     if (_Received != null) _Received(this, new ReceivedEventArgs(e.GetStream()));
 }
예제 #3
0
 /// <summary>
 /// 已重载。
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void OnReceived(object sender, NetEventArgs e)
 {
     if (e.BytesTransferred > 0) StreamHandler.Process(StreamHandlerName, e.GetStream());
 }