Exemple #1
0
        public void Receive(Beetle.Express.IServer server, Beetle.Express.ChannelReceiveEventArgs e)
        {
            ArraySegment <byte> buffer = new ArraySegment <byte>(e.Data.Array, e.Data.Offset, e.Data.Count);
            object      message        = Models.ProtobufPacket.Deserialize(buffer);
            MessageTalk mt             = new MessageTalk();

            mt.Message = message;
            mt.Factory = mFactory;
            GetDispatch().Add(mt);
        }
Exemple #2
0
 public void Receive(Beetle.Express.IServer server, Beetle.Express.ChannelReceiveEventArgs e)
 {
     if (Encoding.UTF8.GetString(e.Data.Array, e.Data.Offset, e.Data.Count) == "GETSN")
     {
         byte[] sn = mCreate.GetValueData();
         Beetle.Express.Data data = new Beetle.Express.Data();
         data.SetBuffer(sn, 0, 8);
         e.Channel.Server.Send(data, e.Channel);
     }
     else
     {
         e.Channel.Dispose();
     }
 }