Re: TCP Socket keepalive
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 12/10/2013 08:26 AM, Haitao Zhang wrote: > I have a problem with the TCP socket, where SWI Prolog is client, > disappearing after some time (presumably some inactivity timer expired). I > have set my server side to keepalive, but that does not seem to help. > > The message I get from trying to use the socket again after a long idle > time: > ERROR: format/3: I/O error in write on stream <stream>(000000000834B260) > (Socket operation on non-socket) > > Any idea on how keep the socket alive? There is tcp_setopt/2, which binds to setsockopt(). It doesn't support the SO_KEEPALIVE option yet. Should be easy enough to add. If you use a source version, see packages/clib. Try it and submit a patch with additional options you see fit. Hope this helps --- Jan > > Thanks, > Haitao > -------------- next part -------------- > HTML attachment scrubbed and removed > _______________________________________________ > SWI-Prolog mailing list > [email protected] > https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >