Re: How Can I call close() for all



David Schwartz <davids@xxxxxxxxxxxxx> writes:

On Nov 27, 8:17 am, Joe Pfeiffer <pfeif...@xxxxxxxxxxx> wrote:
sreyas.j...@xxxxxxxxx writes:

That depends on the client, and what you mean by graceful. Next time
they try to do IO on the socket, the call will fail. What happens
next is up to the client.

Sadly, it is not guaranteed that it will fail. It may succeed and do
something very different from what you wanted.

Your comments in this thread have surprised me a lot -- my impression
has always been that when one end of a socket connection goes away,
the connection is broken. You've been saying (if I understand
correctly) that another process can jump in and grab the port that is
the server's end of the socket, and the client will find itself
talking to the new process.

I'm a bit confused as to how this can happen (before I go any further,
please, if I misunderstood your previous posts, correct me!) -- after
all, when a client connects to the server, a new randomly-numbered
socket is created and the file descriptor returned from accept() is
connected to this socket. How does a new process go about using this
socket after the original server closes its connection? Does it
bind() to it?

Anyway, I'd be very interested in looking at some cites showing me how
this is done....
.



Relevant Pages

  • [PATCH 00/16] AF_RXRPC socket family and AFS rewrite [try #3]
    ... The first of these patches together provide secure client-side RxRPC ... connectivity as a Linux kernel socket family. ... Make certain parameters (such as connection timeouts) userspace ... the connectaddress of a client socket by making use of msg_name in the ...
    (Linux-Kernel)
  • [PATCH 00/16] AF_RXRPC socket family and AFS rewrite [try #4]
    ... The first of these patches together provide secure client-side RxRPC ... connectivity as a Linux kernel socket family. ... Make certain parameters (such as connection timeouts) userspace ... the connectaddress of a client socket by making use of msg_name in the ...
    (Linux-Kernel)
  • [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)