connecting two process through a socket

mixo mixo at beth.uniforum.org.za
Mon Mar 3 02:02:49 EST 2003


What I am trying to do is combine two daemons. The first
daemon logs is status in various ways: file,syslog and status
files which take the form /path/to/status/dir/currentpid/file.
The other daemon is a threading tcpip server which listen on
port 3030 (configurable). The problem I have here is that I
need to get the pid of the first daemon so that second daemon
can feed data to clients.

So, what I am considering is having the first daemon send data to
the second through a socket. Is there a way to have the two
daemons connected this way, and having the second daemon
shutdown when the socket is closed? And how can I make sure
that clients do not connect to the first daemon, only the second?
In other words, can I have a socket server that is connected to
another server as a client?

    ----------           ---------
   |          |         |         |  ------->client1
   | daemon1  |<------->| daemon2 |  ------->client2
   |          |         |         |  ------->clientn
    ----------           ---------





More information about the Python-list mailing list