Skip to content

Make recv non-blocking for macOS and Linux compatibility - #6

Open
VasaviSD wants to merge 1 commit into
nsb-ucsc:mainfrom
VasaviSD:fix/recv-nonblocking-mac-linux
Open

VasaviSD wants to merge 1 commit into
nsb-ucsc:mainfrom
VasaviSD:fix/recv-nonblocking-mac-linux

Conversation

@VasaviSD

Copy link
Copy Markdown
Contributor

This PR updates the socket recv() call to use MSG_DONTWAIT, making reads non-blocking and improving cross-platform behavior on macOS and Linux.

Change

  • Switch from blocking recv(..., 0) to non-blocking recv(..., MSG_DONTWAIT):
  • Prevents the read from blocking the thread when no data is available.

Notes

When no data is available, recv() may return -1 with EAGAIN/EWOULDBLOCK.

Signed-off-by: Vasavi Doddamani <vdoddama@ucsc.edu>

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant