示例#1
0
        protected void OnClientReceived(object sender, NetStreamReceivedEventArgs <T> e)
        {
            NetClientReceivedEventArgs <T> netClientReceivedEventArgs = new NetClientReceivedEventArgs <T>(e.Data, this.EchoMode, e.Guid);

            if (this.OnReceived != null)
            {
                this.OnReceived(this, netClientReceivedEventArgs);
            }
            switch (netClientReceivedEventArgs.EchoMode)
            {
            case NetEchoMode.None:
                break;

            case NetEchoMode.EchoAll:
                this.DispatchAll(e.Data);
                return;

            case NetEchoMode.EchoAllExceptSender:
                this.DispatchAllExcept(e.Guid, e.Data);
                return;

            case NetEchoMode.EchoSender:
                this.DispatchTo(e.Guid, e.Data);
                break;

            default:
                return;
            }
        }
示例#2
0
 protected void stream_OnReceived(object sender, NetStreamReceivedEventArgs <T> e)
 {
     if (this.OnReceived != null)
     {
         this.OnReceived(this, new NetReceivedEventArgs <T>(e.Data));
     }
 }