SUMMARY: Listening (TCP) on single IP, not all IP's

From: Scott Adkins <adkinss_at_ohio.edu>
Date: Wed, 06 Mar 2002 12:08:15 -0500

Thanks to Charles Ballowe for providing us with the solution so quick out
of the gate. I have never had a solution within just a couple minutes of
sending out the email... thanks!

The solution is that we have to zero out the "sockaddr_in" structure
before actually using it. So, the following snippet of code is what
Charles suggested:

  #include <string.h>
  ...

  int main()
  {
    struct sockaddr_in addr;
    bzero((void *)&addr, sizeof(struct sockaddr_in));
    ....
  }

Works like a charm!
Thanks.

Scott
--
 +-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+
      Scott W. Adkins                http://www.cns.ohiou.edu/~sadkins/
   UNIX Systems Engineer                  mailto:adkinss_at_ohio.edu
        ICQ 7626282                 Work (740)593-9478 Fax (740)593-1944
 +-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+
     PGP Public Key available at http://www.cns.ohiou.edu/~sadkins/pgp/

Received on Wed Mar 06 2002 - 17:13:29 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT