Re: [CODE] Socket Problems

From: Cj Stremick (stremick@IX.NETCOM.COM)
Date: 11/04/98

You are zapping your whole struct before sending it to call!  The line you
have commented out is right.  The one you replaced it with (memset) is
wrong.  You only want to "zero out" the member sin_zero.

Also, you can check errno to get the reson why the call failed although in
this case.  The "man connect" will tell you lots more.


-----Original Message-----
From: Jourge Fuzz Bush <modem-burn@GEOCITIES.COM>
To: <>
Date: Wednesday, November 04, 1998 12:01 AM
Subject:  [CODE] Socket Problems

>        dest_addr.sin_family = PF_INET;
>        dest_addr.sin_port = htons(DEST_PORT);
>        dest_addr.sin_addr = *((struct in_addr *)he->h_addr);
>//      bzero(&(dest_addr.sin_zero), 8);
>memset((char *)&dest_addr, 0, sizeof(dest_addr));
>        /*connect socket to remote host*/
>        if (connect(sockfd, (struct sockaddr *)&dest_addr, sizeof(struct
sockaddr)) == -1)
>        {
>                send_to_char("connect error", ch);
>                return;
>        }

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST