Hi,
This is a UDP server ... so I do not use accept, I
simply have a server loop that does a "recv" ...

So the server does a recvfrom and then a sendto on the
same file descriptor... 

When I try to do an accept, that system call fails
because it is not a TCP socket...

Thanks
Lee
--- Elias Athanasopoulos <[EMAIL PROTECTED]> wrote:
> On Fri, Jan 03, 2003 at 11:03:20AM -0800, Lee Chin
> wrote:
> > I can use getpeername to get the IP address of a
> > client on a connected TCP socket, but when I have
> a
> > UDP client that just sent me a packet, how do I
> get
> > the IP address of that UDP client?
> 
> Forgive me if I have misunderstood you, but do you
> use accept() to create
> the new incoming connection? Then the second
> argument to accept() is
> a structure, which contains the information you
> want.
> 
> Have a look at the man page of accept(2).
> 
> Elias
> 
> -- 
> http://gnewtellium.sourceforge.net                    MP3 is not a
> crime.        


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to