Netcat – Listen for Multiple UDP Connections

linux-networkingnetcatnetworkingudp

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.

Best Answer

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.