Beispiel #1
0
 public void Push(IRUdpSession item)
 {
     if (activeDict.TryRemove(item.EndPoint, out item))
     {
         item.EndPoint = null;
         pool.Enqueue(item);
     }
 }
Beispiel #2
0
        public override void OnReceived(IRUdpSession session, IDynamicBuffer dataBuffer)
        {
            var result = new byte[dataBuffer.DataSize];

            Buffer.BlockCopy(dataBuffer.Buffer, 0, result, 0, dataBuffer.DataSize);
            var txt = Encoding.UTF8.GetString(result);

            Console.WriteLine(txt);
            session.SendAsync(data);
        }
 public void Push(IRUdpSession item)
 {
     if (activeDict.TryRemove(item.EndPoint, out item))
     {
         item.EndPoint = null;
         pool.Enqueue(item);
     }
 }
Beispiel #4
0
 public override void OnReceived(IRUdpSession session, IDynamicBuffer dataBuffer)
 {
     var result = new byte[dataBuffer.DataSize];
     Buffer.BlockCopy(dataBuffer.Buffer, 0, result, 0, dataBuffer.DataSize);
     var txt = Encoding.UTF8.GetString(result);
     Console.WriteLine(txt);
     session.SendAsync(data);
 }
Beispiel #5
0
 //当接收到命令包时触发
 public virtual void OnReceived(IRUdpSession session, IDynamicBuffer dataBuffer)
 {
 }
Beispiel #6
0
 //断开连接事件
 public virtual void OnDisConnect(IRUdpSession session)
 {
 }
Beispiel #7
0
 public virtual void OnConnected(IRUdpSession session)
 {
 }
Beispiel #8
0
 //断开连接事件
 public virtual void OnDisConnect(IRUdpSession session)
 {
 }
Beispiel #9
0
 public virtual void OnConnected(IRUdpSession session)
 {
 }
Beispiel #10
0
 //当接收到命令包时触发
 public virtual void OnReceived(IRUdpSession session, IDynamicBuffer dataBuffer)
 {
 }