Bacon, Bonobo, Sockets and Strangeness



Here is the picture, I have an app for which I want single instance
capabilities. To do this, I use libbacon. This app uses Bonobo to
connect to some factories.

If the app crashes, it leaves its socket for Bacon lying around (as
you might expect), the factories are also still running.

When you start the app back up, it finds the socket and attempts to
connect() to it, this succeeds and netstat marks the socket in the
state CONNECTING, but there is no server process to answer this
socket.

This is where it gets weird. If you kill the Bonobo factories it
will all work fine. You can crash out the application, then kill the
factories it was connecting to, but leave the socket lying around.
Bacon will attempt to connect() to the socket, which will fail,
which it will note and become the server.

How is it, that a factory which is not the original server of the
socket can be responsible for holding a socket open after the parent
has been killed?

--d

-- 
Davyd Madeley

http://www.davyd.id.au/
08B0 341A 0B9B 08BB 2118  C060 2EDD BB4F 5191 6CDA



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]