Click to See Complete Forum and Search --> : [RESOLVED] tcp send() problem


lab1
January 29th, 2009, 12:20 PM
Hello all,

The code below connects to a tcp server I have running on my local machine and attempts to send a test message. For some reason the server never seemed to be getting the message so I ran Wireshark to see if it was being sent, but I can not see it. Maybe it doesnt show up on Wireshark if the server and client are both running on 127.0.0.1? Any idea what might be wrong with my tcp client code? I am not getting any errors from the system calls.. the connect() and send() seem to be working.. Anyone have any ideas?

Thanks!

MrViggy
January 29th, 2009, 12:39 PM
I don't know about the code, but if you are using the loopback adapter (127.0.0.1), the packets will never actually leave your machine. IIRC, even if you use your own IP address, the network stack is smart enough to realize that it doesn't actually need to send the packets to the physical media (card; wire).

Viggy

Xionbox
January 29th, 2009, 08:42 PM
If you want to sniff your local machine (without using the network), you have the select the "lo" (or loop back) interface in Wireshack. ;)