Make libsmbclient more fail-safe

Jeremy Allison jra at samba.org
Wed Nov 28 14:50:07 GMT 2001


On Wed, Nov 28, 2001 at 11:41:17PM +0100, Tom Jansen wrote:
> Hi Richard,
> 
> I've been working on a patch for libsmbclient that makes it even more reliable
> regarding to server restarts, network failures etc.
> 
> Now I've run into the following problem: How can I verify if a connection to a
> SMB server is still operational? I can check if cli_state->fd != -1 but that is
> not enough. I want to make sure a server is operational when I give back a
> server from the server cache LL inside libsmbclient. I'm looking for a way to
> send some sort of ping to the server. Is there a way to do this?

Use a SMBkeepalive NetBIOS packet. Look at the send_keepalive()
code in Samba.

> I've got yet another question. Recently, Jeremy removed the "reestablish" code
> from libsmb/clientgen.c. I would like to use a slighty modified version of this
> code to recover from possible server-side disconnects or connection failures.
> Can I move it back in the tree if my patch gets accepted ? 

Doing client re-establishment doesn't make sense in the 
client library (IMHO). It has no knowledge of the state
needed (file open, locks held etc.). That belongs in the
application.

Jeremy.




More information about the samba-technical mailing list