miketeo/pysmb

Impossible to reconnect to smb after close SMBConnection

Anakael opened this issue · 2 comments

python version: 3

steps to reproduce:

  1. create SMBConnection instance with is_direct_tcp=True
  2. call connect on SMBConnection instance
  3. call close on SMBConnection instance
  4. call connect on SMBConnection instance
  5. ConnectionResetError: [Errno 104] Connection reset by peer

@Anakael : pysmb SMBConnection instances are not designed to be reused. Instead, they are modeled to be like file or socket objects which are used and discarded. If you need to re-establish a connection to the same SMB server after close(), you should create a new SMBConnection instance.

I see.
Thank you for explanation!