I'm learning C net programming from Beej's guide to network programming. Great guide.
But two the example programs listener.c and talker.c do not work as expected on my machines. These are simple programs to demonstrate datagram sockets; listener listens on a port, talker sends a packet to that port.
The code is from this section of the guide.
I've tried running the two programs on the same machine and on seperate machines, both times the listener never gets a packet and just hangs there.
I run the listener program first, then from another machine I run the talker program like this:
but the listener NEVER gets the packet. What could be going wrong?
I've posted this in another forum and some linux people have tried it and it works fine for them. Why does it not work for me?
But two the example programs listener.c and talker.c do not work as expected on my machines. These are simple programs to demonstrate datagram sockets; listener listens on a port, talker sends a packet to that port.
The code is from this section of the guide.
I've tried running the two programs on the same machine and on seperate machines, both times the listener never gets a packet and just hangs there.
I run the listener program first, then from another machine I run the talker program like this:
Code:
talker 10.1.1.5 hello
I've posted this in another forum and some linux people have tried it and it works fine for them. Why does it not work for me?