Maintaining socket connections



 Folks,

   I'm working on a pair of processes, one multithreaded and one
single-threaded.  The multithreaded process monitors incoming data
on a TCP socket and a UDP socket, captures the data as it comes in
and cleans it up, then writes it through another TCP socket to the
second process.  I am running into problems with that socket just
closing off intermittently.  Both processes are still running, but
the data stops flowing.  No errog log output to indicate that the
socket is broken, nothing.  It just stops working.  The receiving
process tries to read the socket and gets nothing, and the sending
process stops writing packets because the socket is no longer
writable.  I've got code in place that is supposed to close the
socket and reconnect, but it doesn't seem that it ever gets
triggered.

   On the receiving end, I'm just using vanilla socket code; on
the multithreaded side, I'm using gnet and giochannels.  This
code originally connected through a UNIX socket but I'm trying
to make it network-capable.  The UNIX socket version would stay
up for literally MONTHS at a time.  I MUST have that level of
stability.  Am I wasting my time?  Is glib and giochannels not
capable of providing that?  Can anyone point me to an app that
successfully uses them to maintain a *constant* connection, with
automatic reconnection if the connection is somehow lost?

thanks,
Jim




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