I'm sorry, I should've made my question clearer, I'm using TCP sockets. I'm just trying to test whether a connection has been made by connecting again and catching the error. I know there are better ways of doing this, but I was surprised when the second connect() succeeded. I've tested this out on other OS's SunOS, FreeBSD, IRIX and Win2k( here i used python to call the underlying windows implementation), and a second connect() always returns an error. Thanks, Vasisht On 9 Aug 2002, Nat Ersoz wrote: > In UDP land (which I assume you're using - doesn't make sense in TCP, > does it?), I have to set setsockopt( ..., SO_REUSEADDR, ... ) in order > to open a socket more than once. > > calling sequence: > socket(); > setsockopt(SO_REUSEADDR); > bind( interface ); // bind to group for mcast > > I'm not sure if I answered your question. > > Nat > > > On Thu, 2002-08-08 at 12:07, Vasisht Tadigotla wrote: > > > > Hi, > > > > i'm doing the following steps, > > > > 1. open a socket on some remote server > > 2. set it to be non-blocking > > 3. connect to that socket > > 4. do a select on the socket > > 5. read from the socket > > 6. connect to the socket again > > 7. read from the socket > > > > and as expected a EINPROGRESS error is thrown on step 3. After I do a > > select() and read from that socket, I try to connect to it again and it > > connects without throwing an EISCONN error in linux, though if I try to > > read from it it throws a EAGAIN error. Shouldn't it throw an error when I > > try to connect to it a second time ? Am I missing something here. > > > > > > TIA, > > > > Vasisht > > > > > > Please CC as I'm not the list. > > > > - > > : send the line "unsubscribe linux-net" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > _________________________________________ > Nat Ersoz Myrio Corporation -o) > nat.ersoz@myrio.com Cell: 425-417-5182 /\\ > Phone: 425.897.7278 Fax: 425.897.5600 _\_V > 3500 Carillon Point Kirkland, WA 98033 > --------------------------------------------------------------------- ce .sig n'est pas une .sig - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html