Re: Closing a listener

[email protected] (Jonas Borgström) 28 Dec 2002 20:01:56 +0100
Newsgroups gmane.network.beep.roadrunner.general
Message-ID <[email protected]>
Matt Small <[email protected]> writes:

> I'm looking at shutting down a listener, and I'd like to shutdown all the
> connections that it's received (and that are still open) at the same time.
> Right now, I'm not keeping track of the connections anywhere; I noticed t=
hat the
> listener maintains a GList connection, which I assume holds all the conne=
ctions,
> as well as a GList dead_connection, which holds the dead connections and =
is
> flushed regularly.
>=20
> If I was to iterate through the connection list, and close all of the ind=
ividual
> connections, will that cover all the connections that that listener had
> received?  Is there a better, public-interface sort of way to do it?
>=20
Hi,

sorry for the late reply...

http://afs.codefactory.se/~jonas/roadrunner/disconnect.diff

The patch above implements two functions.

* rr_listener_disconnect_all (listener, error): This function disconnects a=
ll=20
  active connections for the given listener (note: new peers can still conn=
ect=20
  afterwards).

* rr_listener_shutdown (listener, error): disconnects all active connection=
s and
  stops listening for new connections. The listener object is also unref:ed.

Is this what you are looking for?

I will apply the patch to the cvs repository after I have done further test=
ing.

/ Jonas
--=20
Jonas Borgstr=F6m                  [email protected]
CodeFactory AB                   http://www.codefactory.se/
Office: +46 (0)90 71 86 14