code8230
code8230

Reputation: 57

UDP Port access

I have a small server program in C which prints a message to the client. This program uses UDP Port for communication.

My question is: Is there a way or application by which I can test the functionality of my program from my windows machine. Example, if I type in some command, I can see the response from my program on my computer.

telnet xx.xx.xx.xx. PortNum, I believe telnet wpuld not work.

Upvotes: 0

Views: 471

Answers (2)

Andrew of Scappoose
Andrew of Scappoose

Reputation: 467

I think you may want to use netcat; if it's installed on your machine, it's typically executed by "nc"

netcat can connect to or listen on tcp or udp ports; -u is udp.

nc -u host port # connect to a udp port

nc -u -l 127.0.0.1 1026 # listen on port 1026, in udp mode.

etc.

Upvotes: 0

Alec Danyshchuk
Alec Danyshchuk

Reputation: 307

Not aware of any existing tools. I assume your server receives a message from the client and sends a response message back. If this is correct, create a basic client program which sends a message (sendto()) and then calls recvfrom() (default is blocking mode on my platform), then print the response message received. This works well for me. Don't have time to ferret around for an example (which is on linux) but you should be able to use an example udp client for windows from the web, I imagine. Let me know if you would like my client program as a template.

Upvotes: 1

Related Questions