markiodev / Networker

A simple to use TCP and UDP networking library for .NET. Compatible with Unity.
MIT License
477 stars 77 forks source link

udp数据传输长度为0 #55

Open qinqoushui opened 4 years ago

qinqoushui commented 4 years ago
  1. 在IServerPacketProcessor中声明如下:

    void ProcessUdpFromBuffer(EndPoint sender, byte[] buffer, int offset = 0, int length = 0);
  2. 在UdpClientListener中未指定数据长度

    private async Task Process(EndPoint endPoint, byte[] buffer)
        {
           // serverPacketProcessor.ProcessUdpFromBuffer(endPoint, buffer);
            serverPacketProcessor.ProcessUdpFromBuffer(endPoint, buffer,0,buffer.Length);
            endPointPool.Push(endPoint);
        }