All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting the IP address of a UDP client
@ 2003-01-03 19:03 Lee Chin
  2003-01-04  0:13 ` Elias Athanasopoulos
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Chin @ 2003-01-03 19:03 UTC (permalink / raw)
  To: hahn, linux-newbie

Hi
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?

Thanks
Lee

__________________________________________________
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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the IP address of a UDP client
  2003-01-03 19:03 Getting the IP address of a UDP client Lee Chin
@ 2003-01-04  0:13 ` Elias Athanasopoulos
  2003-01-04  0:22   ` Lee Chin
  0 siblings, 1 reply; 6+ messages in thread
From: Elias Athanasopoulos @ 2003-01-04  0:13 UTC (permalink / raw)
  To: Lee Chin; +Cc: hahn, linux-newbie

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.	
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the IP address of a UDP client
  2003-01-04  0:13 ` Elias Athanasopoulos
@ 2003-01-04  0:22   ` Lee Chin
  2003-01-05  0:20     ` digest? Jonathan Kallay
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Chin @ 2003-01-04  0:22 UTC (permalink / raw)
  To: Elias Athanasopoulos; +Cc: hahn, linux-newbie

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 <eathan@otenet.gr> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* digest?
  2003-01-04  0:22   ` Lee Chin
@ 2003-01-05  0:20     ` Jonathan Kallay
  2003-01-05  2:23       ` digest? LL Phillips
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Kallay @ 2003-01-05  0:20 UTC (permalink / raw)
  To: linux-newbie

Is there a way to get a daily digest from this mailing list, instead of
getting each message individually?

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: digest?
  2003-01-05  0:20     ` digest? Jonathan Kallay
@ 2003-01-05  2:23       ` LL Phillips
  2003-01-05  2:33         ` digest? Ray Olszewski
  0 siblings, 1 reply; 6+ messages in thread
From: LL Phillips @ 2003-01-05  2:23 UTC (permalink / raw)
  To: Jonathan Kallay, linux-newbie

Hi Jonathan
I haven't found one.
If anyone knows of one I hope they answer to the list.
Lorraine

Jonathan Kallay wrote:
> 
> Is there a way to get a daily digest from this mailing list, instead of
> getting each message individually?
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: digest?
  2003-01-05  2:23       ` digest? LL Phillips
@ 2003-01-05  2:33         ` Ray Olszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Ray Olszewski @ 2003-01-05  2:33 UTC (permalink / raw)
  To: linux-newbie

This list is pretty much ignored by the folks who run things at vger, so I 
doubt you'll get an authoritative answer to this question. But in my 
several years on this list, I've never seen any mention of a digest version.

OTOH, and to my surprise, I jusr discovered that there are two archives of 
the list. They are listed at

         http://vger.kernel.org/vger-lists.html

in the section on linux-newbie. The Sourceforge one is not current, but the 
other one is up to date. I suppose that is an anternative for people who 
find the individual messages to consritute too much traffic. Beware, though 
... my expeirnec is that list archives for this list come and go, 
unpredictably.

Of course, I could be wrong.

At 09:23 PM 1/4/03 -0500, LL Phillips wrote:
>Hi Jonathan
>I haven't found one.
>If anyone knows of one I hope they answer to the list.
>Lorraine
>
>Jonathan Kallay wrote:
> >
> > Is there a way to get a daily digest from this mailing list, instead of
> > getting each message individually?




--
-------------------------------------------"Never tell me the odds!"--------
Ray Olszewski					-- Han Solo
Palo Alto, California, USA			  ray@comarre.com
-------------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-05  2:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 19:03 Getting the IP address of a UDP client Lee Chin
2003-01-04  0:13 ` Elias Athanasopoulos
2003-01-04  0:22   ` Lee Chin
2003-01-05  0:20     ` digest? Jonathan Kallay
2003-01-05  2:23       ` digest? LL Phillips
2003-01-05  2:33         ` digest? Ray Olszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.