OK I just tried the two apps on a local machine, here is what I used to build and how it worked for me:
Code:
jeff@jeff-gate:~/dev/beej/talker$ gcc ./talker.c -o talker
jeff@jeff-gate:~/dev/beej/talker$ ./talker 127.0.0.1 hello
talker: sent 5 bytes to 127.0.0.1
jeff@jeff-gate:~/dev/beej/talker$
and the listener:
Code:
jeff@jeff-gate:~$ cd dev/beej/listener/
jeff@jeff-gate:~/dev/beej/listener$ gcc ./listener.c -o listener
jeff@jeff-gate:~/dev/beej/listener$ ./listener
listener: waiting to recvfrom...
listener: got packet from 127.0.0.1
listener: packet is 5 bytes long
listener: packet contains "hello"
jeff@jeff-gate:~/dev/beej/listener$
Seems to work. I will throw one across the network to make sure it works machine to machine. One thing came to mind while working on this was this: do you have a firewall of ANY kind (software or hardware) running inbetween the two machines? I think Windows comes with one turned on by default IIRC. The above code BTW was compiled and ran on a Linux box running kernel:
Code:
jeff@jeff-gate:~/dev/beej/listener$ uname -a
Linux jeff-gate 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 18:57:07 UTC 2009 i686 GNU/Linux
jeff@jeff-gate:~/dev/beej/listener$
BIAB..
Jeff