gabriel rosenkoetter on 22 Feb 2004 17:32:03 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] UDP programming question


On Sun, Feb 22, 2004 at 11:33:25AM -0500, Jeff Abrahamson wrote:
> I've been googling, gdb'ing, and reading man pages for too long.  Any
> suggestions on what I mean to do here?

Did you read this bit:

     If from is non-nil, and the socket is not connection-oriented, the source
     address of the message is filled in.  fromlen is a value-result parame-
     ter, initialized to the size of the buffer associated with from, and mod-
     ified on return to indicate the actual size of the address stored there.

?

>     struct sockaddr_in faddr; /* address of remote peer */
>     int num_read;
> 
>     memset(&faddr, 0, sizeof(faddr));

You're explicitly setting faddr to be exactly what will never get
filled in. That is, nil.

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpAbBIaNvyLn.pgp
Description: PGP signature