jordanlytle / SmbAbstraction

Implements the System.IO.Abstractions interfaces for interacting with the filesystem, and adds support for interacting with UNC or SMB paths
MIT License
6 stars 8 forks source link

Release unusable SMBConnection #31

Closed wgv-jxiao closed 4 years ago

wgv-jxiao commented 4 years ago

When SMBConnection is not connected, we need to dispose it in order to create a new one.

Jo0 commented 4 years ago

Changes look okay. Can you comment on how you discovered or why this change is needed? It'd be nice to have some description on what was happening that needed this. Just for the sake of documentation on this merge.

wgv-jxiao commented 4 years ago

This is discovered when we work on video playback. Sometimes the file connection get cutoff when retrieving file information. I added retry to reconnect. However, it try to reuse the cached connection which the underline client is already disconnected. We need to dispose and remove the old connection from cache, So we can create new connection and client.

Jo0 commented 4 years ago

Thanks Jun!