- From: rohit agrawal <agrawal_rohit1 AT yahoo.co.in>
- To: Thomas Dreibholz <dreibh AT iem.uni-due.de>
- Cc: sctp <discussion AT sctp.de>
- Subject: Re: [SCTP-Discussion] How to determine whether message is on TCP or SCTP socket descriptor?
- Date: Mon Apr 10 05:22:00 2006
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=nG93CLMbLHbB2nxbgyEX9adwyWUt2vKhcUPZTyovl1FcIrzpxFHbLTanQPG140I2L/0aYb1dciIl6VloZHzOiw1iX16T371K2U7W/2imJw4K464exP9oedaUg3P+auS93GXFetjATz9VIDe+NLSUAZW9Ypigy0tPN5J2EJnMjG4= ;
- List-id: SCTP Discussions <discussion.sctp.de>
Hi Thomas,
Thanks for your response but I think i quoted my problem in the wrong manner. It is correct that using select or poll function i can determine on which socket fd the event has occured. But my question is how can i determine from the socket fd alone that it is fd generated from TCP or UDP or SCTP socket functions. Because once i know from the socket fd type my application needs to do something (implement connection reuse). Earlier using getsockopt with SOCK_TYPE parameter return either datagram or stream socket, which can distinguish between UDP and TCP, but i cannot distinguish between TCP and SCTP.
Another question which i have is kernal supported socket's API on UDP and TCP are compatilbe with socket's API on SCTP (socketsapi 1.7.0). I mean to say when a socket fd has been generated with ext_socket function can that socket fd be used with select/getsockopt/poll function which the
kernal supports ??
I would be thankful to you if could resolve my queries.
Regards
Rohit Agrawal
Thomas Dreibholz <dreibh AT iem.uni-due.de> wrote:
On Wednesday 05 April 2006 14:01, rohit agrawal wrote:
> Hi ,
>
> I have a question? I want to have a server application which is listening
> on UDP ,TCP and SCTP port(one to one style socket). Now if a message has
> arrived on the server application how will it determine that message has
> come on which socket fd ? Using getsockopt function i could determine
> whether the message has come on UDP or TCP only. Also the ext_getsockopt
> function (present in socketapi-1.7.0)determines options only for SCTP.
>
> For TCP and SCTP (one to one style socket) the socket type is
>
SOCK_STREAM.
>
> I would be thankful if there is some way to know on which fd message has
> arrived.
Use ext_poll() or ext_select(). I recommend ext_poll(), because poll is more
efficient. Read the manual pages for "poll" and "select" for details.
Best regards
--
=======================================================================
Dipl.-Inform. Thomas Dreibholz
University of Essen, Room ES210
Inst. for Experimental Mathematics Ellernstraße 29
Computer Networking Technology Group D-45326 Essen/Germany
-----------------------------------------------------------------------
E-Mail: dreibh AT exp-math.uni-essen.de
Homepage: http://www.exp-math.uni-essen.de/~dreibh
=======================================================================
Jiyo cricket on
Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.
Archive powered by MHonArc 2.6.19+.