UnixServer example doesn't work on Mac with either nc or socat
See original GitHub issueI’m trying to make a server using the UnixServer example as a starting point. On my Mac, when I send more than two buffers worth to it, it just hangs and no longer reads more data. Here are two example commands that should work (and do work on Linux).
➜ ~ cat .emacs | socat UNIX-CONNECT:/tmp/fubar.sock -
➜ ~ cat .emacs | nc -U /tmp/fubar.sock
All I’m doing is running the UnixServer class straight out of the box. I’m using version jnr-unixsocket 0.28.
The funny thing is that if I make the ByteBuffer smaller than 1024 (like 512), it hangs after just 1 buffer read. All buffer sizes work fine on Linux.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Netcat on Mac OS X - Super User
Install using Homebrew: brew install netcat · One can use either the nc or netcat command. nc is an alias for netcat ....
Read more >If Safari on Mac doesn't open a webpage or isn't working as ...
To find out whether the issue is with your network itself, try viewing the website after connecting to a different network. Resolve other...
Read more >How can I communicate with a Unix domain socket via the ...
Example command: nc -U /var/run/socket ... it may look like it doesn't support unix domain sockets (the -U option doesn't exist) but I...
Read more >1. Getting Started - Learning Unix for Mac OS X, Second ...
Working in the Unix Environment. To get into the Unix environment, launch the Terminal application. (That's Finder → Applications → Utilities → ...
Read more >How to make an Echo server with Bash? - tcp - Stack Overflow
If you use ncat instead of nc your command line works fine with multiple connections but (as you ... In case ncat is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With the UnixServer working properly now on Darwin, I’m going to close this issue.
From discussions and articles online, it appears this may be just one of the “quirks” of using poll across platforms. It does not appear that additional POLL_IN events get triggered for unread data that happens to be lying around in a kernel buffer, so code that responds to a READ select should attempt to read as much data as is available before doing another select.
Releasing today in 0.29.