Re: Timeout for connect()

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 03/01/04


Date: Mon, 01 Mar 2004 16:21:20 -0500

In article <72ce7f0c.0403010952.573dc94f@posting.google.com>,
 JoJoTwilligo@hotmail.com (Jo) wrote:

> That's what I was thinking of. Is there any danger in closing a
> socket that hasn't been opened? If not, then I would think the proper
> solution would be to close the socket once you know that the connect
> is to be canceled.

Once you create the socket using socket(), you *must* close it when
you're not interested in using it any more. I guess what you meant was
"is there any danger in closing a socket whose *connection* hasn't been
opened?" No, there isn't -- listening sockets don't have open
connections and it's fine to close them.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)
  • Re: attn:MVPs
    ... winsock dll to the managed .net environment. ... I have an asynchronous TCP socket that listens for data from ... The Slave should not initiate any connection requests/ send other messages ... EXCEPT the acknowledgement for the incoming messages from master, ...
    (microsoft.public.dotnet.framework)