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

sending large messages (over 65535 bytes) fails #108

Closed
d1g1t4l opened this issue Sep 11, 2015 · 0 comments
Closed

sending large messages (over 65535 bytes) fails #108

d1g1t4l opened this issue Sep 11, 2015 · 0 comments

Comments

@d1g1t4l
Copy link

d1g1t4l commented Sep 11, 2015

I created a multi-megabyte batch and captured the network traffic while trying to send it. Only the first ~65535 bytes of the batch got sent. The problem is in OrientSocket.write in orient.py:

    def write(self, buff):
        return self._socket.send(buff)

This works for small buffers but is not guaranteed to send the full buffer when the size is large. The following code fixes the issue:

    def write(self, buff):
        count = 0
        while count < len(buff):
            count += self._socket.send(buff[count:])
        return count
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