-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Net.Sockets.SocketException: Connection reset by peer #225
Comments
The examples for client connections clearly show you have to call both |
And I suppose filestore.Disconnect() won't hurt Could it be that there is some background thread which listens for communication with the server, which simply stops with an unhandled socket exception? The client code to retrieve directory listings and files itself works fine. |
just reading source code and c# docs.. https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.disconnect?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.close?view=net-7.0
So maybe a Shutdown should be called, or the async callback deregisterd. I am not sure. I only have 6months of experience in C#, so appologies if anything here is real basic stuff. |
A small update: Today, we created a fork of this project and tested locally socket.Shutdown, socket.Close, even calling EndReceive Unfortunately, none of our tests made any difference. The socket exception is still being thrown on the background thread. |
It's not clear what the action item is here nor a clear indication that there is an issue with current implementation. Closing the issue. |
Hi,
we followed examples on how to close the connection of SMB2Client property and called:
fileStore.Disconnect()
However we noticed that approx. 10 min later a SocketException is thrown on an async background thread, telling us that the client closing the underlying socket.
It seems as if the socket remains open and times out after some time.
Thus, we tried the following:
The if statement in the third line still evaluates to true - even after a fileStoreDisconnect().
client.Disconnect() gets called, however this also causes a SocketException to be thrown on a background thread.
It seems as if, either the documentation has to be updated on how to propery close the connection, or the underlying socket must be closed cleanly.
The text was updated successfully, but these errors were encountered: