From: Jeff Woods <kazrak+kernel@cesmail.net>
To: Fekete Gabor <feketga@delfin.unideb.hu>
Cc: linux-c-programming <linux-c-programming@vger.kernel.org>
Subject: Re: using the same port with two sockets
Date: Thu, 25 Sep 2003 10:15:52 -0700 [thread overview]
Message-ID: <5.2.1.1.0.20030925100439.01af0250@no.incoming.mail> (raw)
In-Reply-To: <Pine.A41.4.20.0309251006170.140698-100000@delfin.unideb.hu >
At 9/25/2003 10:16 AM +0200, Fekete Gabor wrote:
>with SOCK_STREAM if the server accept()s a connection it creates
>another sokcet that can be used to handle that connection.
>I want to do the same but with SOCK_DGRAM.
>So what I want is to recvfrom() a "connection" request and then
>create another socket to handle that "connection", that is, the
>server would go back to recvfrom() requests without worrying about
>packets arriving from the previously "accepted" client which would
>send those packets to the socket created especially for it.
>Is it possible?
Unlike SOCK_STREAM (aka TCP sockets) SOCK_DGRAM (aka UDP sockets) are
connectionless. Every new UDP packet arrives at the single listening
socket which is bound to the UDP port addressed. You can not have two
sockets listening on the same UDP port (IIUC).
I recommend Richard Stevens' book "Unix Network Programming" (ISBN:
013490012X ) for an excellent explanation.
http://www.amazon.com/exec/obidos/ASIN/013490012X
--
Jeff Woods <kazrak+kernel@cesmail.net>
next parent reply other threads:[~2003-09-25 17:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.A41.4.20.0309251006170.140698-100000@delfin.unideb.hu >
2003-09-25 17:15 ` Jeff Woods [this message]
2003-09-25 19:35 ` using the same port with two sockets Fekete Gabor
2003-09-26 5:51 ` Patrik Jönsson
2003-09-26 15:28 ` Fekete Gabor
2003-09-25 8:16 Fekete Gabor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.2.1.1.0.20030925100439.01af0250@no.incoming.mail \
--to=kazrak+kernel@cesmail.net \
--cc=feketga@delfin.unideb.hu \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).