Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP OnReceived(buffer, 0, received); #293

Open
jintemp opened this issue Apr 11, 2024 · 1 comment
Open

TCP OnReceived(buffer, 0, received); #293

jintemp opened this issue Apr 11, 2024 · 1 comment

Comments

@jintemp
Copy link

jintemp commented Apr 11, 2024

    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

@lifeengines
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants