I'm trying to use netcat to debug SIP calls, which communicate over UDP.

Is there a way to get the same netcat instance to listen to multiple UDP Connections? I've tried connecting to the same netcat session from two different hosts and the second is always unable to connect, even when I send an EOF from the first.

I'm aware that UDP "Connection" is a misnomer and that no such thing exists, am I thinking about this in the wrong way?

I'm version agnostic as I have both OpenBSD and Ubuntu "traditional" (GNU Debian) netcats installed.

I've tried the -k flag in OpenBSD to no avail.

Any ideas are appreciated.


The author of the ncat tool, in his page for netcat users notes that:

By default, Ncat will accept 100 simultaneous connections, instead of 1 like the original netcat. Use -m to specify the maximum number of simultaneous connections.

I rather suspect this means that netcat won't do what you want, but there's a simple drop-in replacement tool which will.

  • Thank you, that's a really useful upgrade. I've used it's --sh-exec option to get somewhere near where I want, but unfortunately in listen mode lots of background ncat instances are getting left running. Next question! – c_oreills May 6 '11 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.