hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
713 stars 180 forks source link

Add support for unregistering server from serverlist (Fixes #644) #647

Closed hierynomus closed 3 years ago

hierynomus commented 3 years ago

Correct, the exception has not been removed. You will need to catch the exception and then call SMBClient.getServerList().unregister(<serverName>); and after that reconnect to the server.

The server's details are cached and checked for a new connection. If there is a mismatch in server details when re-connecting to the server, the MS-SMB2 spec specifies that the connection should be disconnected and the application should be informed. To overcome this, you can call the unregister method I've added.

You will need to code this up in your own code, as SMBJ is low-level and I do not want to add magic reconnection behaviour without the user of the library being aware.

rokkakasu commented 3 years ago

Hi @hierynomus,

the changes are working as expected. once merged please feel free to close the ticket.

thanks a lot for your help. Thanks, R Ramarajan.

rokkakasu commented 3 years ago

Hi @hierynomus ,

Please release 0.11.2 version we are waiting for the newer version.

Thanks, R Ramarajan.

rokkakasu commented 3 years ago

Hi @hierynomus,

I have enhanced a CAMEL-SMBJ Component from https://github.com/cchet-camel-extras/camel-smbj using your smbj library , Camel team is fine to accept for review https://issues.apache.org/jira/browse/CAMEL-12563

please share me your thoughts will you approve to use your library for CAMEL EIP?

Thanks, R Ramarajan.

hierynomus commented 3 years ago

@vrr6 Let's take this discussion to a separate issue. I'm not sure what you mean with the CAMEL EIP? SMBJ is a library licensed under the Apache license. That means that you are free to include it as a library for other components to build upon.

mnadeem commented 3 years ago

Caching objects ( connection for example) is higher level abstraction, if there is a (automatic) provision to cache in a library there should be mechanisms (automatic) to deal with the anomalies introduced by caching or provide mechanism to disable caching altogether.

Just a thought @hierynomus