CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Posts
    1,029

    [RESOLVED] tcp send() problem

    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!
    Last edited by lab1; January 29th, 2009 at 03:13 PM.

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: tcp send() problem

    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

  3. #3
    Join Date
    Jan 2009
    Posts
    3

    Re: [RESOLVED] tcp send() problem

    If you want to sniff your local machine (without using the network), you have the select the "lo" (or loop back) interface in Wireshack.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured