Re: [UDT] SO_REUSEADDR
Brought to you by:
lilyco
From: <ar...@ph...> - 2006-07-22 22:22:35
|
Yunhong, Thank you for your reply. I do have an idea. Can you tell me if this is possible. Can UDT use IP:port obtained from getpeername() to confirm that the socket is the right one prior to set m_bConnected=ture. If the socket is wrong, can UDT go thru this again with other sockets until it finds the right one. P.S. In void CUDT::connect(const sockaddr* serv_addr) ... if ((0 != strcmp(req_ip, res_ip)) || (0 != strcmp(req_port, res_port))) ... Art Pharn udt...@li... wrote: Send UDT-general mailing list submissions to udt...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/udt-general or, via email, send a message with subject or body 'help' to udt...@li... You can reach the person managing the list at udt...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of UDT-general digest..." Today's Topics: 1. SO_REUSEADDR (ar...@ph...) 2. Re: SO_REUSEADDR (Yunhong Gu) ---------------------------------------------------------------------- Message: 1 Date: Fri, 21 Jul 2006 13:31:12 -0700 (PDT) From: Subject: [UDT] SO_REUSEADDR To: udt...@li... Cc: Art Pharn Message-ID: <200...@we...> Content-Type: text/plain; charset="iso-8859-1" Yunhong, First, I'd like to complement on the UDT. I have a question about the SO_REUSEADDR. Does the implementation of UDT prohibit the use of SO_REUSEADDR? When I modify UDT such that I can set the SO_REUSEADDR option directly on sockets that use the same local port, to the same remote host but with diff. remote ports, I found out that I could get a connect on the wrong socket, i.e wrong remote port. Thanks, Art Pharn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://sourceforge.net/mailarchive/forum.php?forum=udt-general/attachments/20060721/96b597ac/attachment.html ------------------------------ Message: 2 Date: Fri, 21 Jul 2006 16:06:29 -0500 (CDT) From: Yunhong Gu Subject: Re: [UDT] SO_REUSEADDR To: Art Pharn Cc: udt...@li... Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed I think it is the problem of UDP with SO_REUSEADDR. When you have two UDP sockets bound to the same port, it seems there is no way to guarantee that an incoming packet goes to one socket rather than the other, becuase UDP is connectionless, it cannot use source IP:port to determine the destination socket. The outcome may depend on different system implementations. Due to the same reason, the conenction request from remote host may reach any local UDT listening socket, thus you may get wrong connection. I don't think there is any way to support SO_REUSEADDR in UDT, but if you have any idea, I would like to try. Thanks Yunhong On Fri, 21 Jul 2006 ar...@ph... wrote: > Yunhong, > > First, I'd like to complement on the UDT. > > I have a question about the SO_REUSEADDR. Does the implementation of UDT prohibit the use of SO_REUSEADDR? When I modify UDT such that I can set the SO_REUSEADDR option directly on sockets that use the same local port, to the same remote host but with diff. remote ports, I found out that I could get a connect on the wrong socket, i.e wrong remote port. > > Thanks, > > Art Pharn > ------------------------------ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ------------------------------ _______________________________________________ UDT-general mailing list UDT...@li... https://lists.sourceforge.net/lists/listinfo/udt-general End of UDT-general Digest, Vol 2, Issue 4 ***************************************** |