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

Socket::irecv / isend show faulty behavior when bufsize > MAX_INT #5

Open
blootsvoets opened this issue Jul 16, 2013 · 0 comments
Open

Comments

@blootsvoets
Copy link

The status of C ::send and ::recv is read as an int, but if the buffer size is larger than that, it will deduce there is an error when there is not. In pseudo-code:

char *buf, long long int size;
int status = ::send(buf, size);
if (status < 0)
   report_error();

However, if size is larger than MAX_INT and this is successfully returned by ::send, status will be smaller than zero through casting.

I think its reasonable to assume that the input size should be an int, or that ::send will always return less than MAX_INT, but maybe an explicit comment about these assumptions would be good.

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

1 participant