NetCoreServer icon indicating copy to clipboard operation
NetCoreServer copied to clipboard

TCP OnReceived(buffer, 0, received);

Open jintemp opened this issue 2 months ago • 1 comments

    public virtual long Receive(byte[] buffer, long offset, long size)
    {
        if (!IsConnected)
            return 0;

        if (size == 0)
            return 0;

        // Receive data from the server
        long received = Socket.Receive(buffer, (int)offset, (int)size, SocketFlags.None, out SocketError ec);
        if (received > 0)
        {
            // Update statistic
            BytesReceived += received;

            // Call the buffer received handler
            OnReceived(buffer, 0, received);
        }

OnReceived(buffer, 0, received); This should be offset, not 0 Look forward to your reply

jintemp avatar Apr 11 '24 03:04 jintemp

I also believe this is a bug, but it just so happens that in the original project, all the code that calls this place happens to pass zero.

lifeengines avatar May 05 '24 07:05 lifeengines