I'm trying to test UDP between 2 terminals in the same machine.
For instance:
Terminal 1
- UDP listener@port:3000
- UDP sender to port:3001
Terminal 2
- UDP listener@port:3001
- UDP sender to port:3000
and testing the above under the environment - MacOSX terminal and Linux Terminal (Android Emulators).
Anyone knows command for this?
I've googled and found nc
for UNIX, but for OSX
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/nc.1.html
$ nc [~]
usage: nc [-46AcCDdFhklMnOortUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port]
[-s source_ip_address] [-w timeout] [-X proxy_version]
[-x proxy_address[:port]] [hostname] [port[s]]
It seems that nc
does not have -u
option for UDP.
EDIT:
I've got answers that suggest the OSX nc
does have -u
option.
Having said that. Aside from this Question, here's what I've done as the final approarch;
For OSX:
I use node.js instead of Shell commands for these UDP testing. This is much more powerful and comfortable to me.
For Android(Linux):
I prepared a test Android App project to test. Clone the project, and open the identical projects, and run 2 identical instances(emulators).
Just for future references.
nc [-....u..]