Esempio n. 1
0
 internal int RawSend(byte[] buffer, int offset, int length)
 {
     if (m_Dispose)
     {
         return(-20);
     }
     return(m_Con.RawSend(buffer, offset, length));
 }
Esempio n. 2
0
 public void SendPackets(KcpCon kcp, HConcurrentQueue <Packet> packets)
 {
     while (packets.TryDequeue(out Packet packet))
     {
         int size = PacketProcessing.Send(m_Buffer, packet);
         if (size > 0)
         {
             if (packet.Channel == ChannelType.Reliable)
             {
                 kcp.Send(m_Buffer, 0, size);
             }
             else if (packet.Channel == ChannelType.Unreliable)
             {
                 kcp.RawSend(m_Buffer, 0, size);
             }
         }
     }
 }