Comments (2)
Thanks for bringing this up, a thread should definitely be linked to the connection and stopped once the connection is disconnected.
from smbprotocol.
Sorry for the delay but I had another look into this and the threads for each connection will be stopped when you run .disconnect()
. In the diconnect()
function it calls self.transport.close()
smbprotocol/smbprotocol/connection.py
Line 804 in 4dff793
Part of closing the transport is to close the socket by sending the shutdown signal, waiting for that thread to finish then finally closing the socket
smbprotocol/smbprotocol/transport.py
Lines 91 to 93 in 4dff793
When the actual socket is shutdown by either the client or the server, it is set to always add None
to the connection thread queue
smbprotocol/smbprotocol/transport.py
Lines 134 to 136 in 4dff793
Finally once the recv_queue
receives None
(the socket has been closed) it exits the process which subsequently stops the thread
smbprotocol/smbprotocol/connection.py
Lines 1110 to 1114 in 4dff793
If you are finding this is not the case on your setup I'm happy to have a further look but it does seem like the thread will be cleaned up when you disconnect from the connection. Even when running a test I found that the only thread still running after calling .disconnect()
is the main thread.
from smbprotocol.
Related Issues (20)
- how to load a numpy file on smb HOT 4
- `reset_connection_cache` not deleting on disconnection failure. HOT 1
- standard `kwargs` not supported in `copytree` HOT 5
- Difference between SMBDirEntry._dir_info and .stat() HOT 8
- On disconnectt wait for msg_worker thread to end. HOT 2
- Example/Documentation unclear for low level reading of file size. HOT 6
- Unable to login to Azure drives from linux HOT 1
- Cannot use `share_access="r"` with `smbclient.shutil.copytree()` HOT 10
- smbprotocol.connection.Connection.connect() no longer shows the low-level connection error HOT 5
- Compounded related requests: should TreeId and SessionId be set to 0xff..ff? HOT 3
- SpnegoError when connecting to impacket test server HOT 5
- smbprotocol.transport.Tcp._recv can end up in a dead lock HOT 4
- `listdir` requires server name on its call
- Wrong raw_type when deleting a directory HOT 1
- mkdir -p recursive directory create HOT 2
- Enquiry about exception propagation in `transport.py` HOT 2
- SMBAuthenticationError sometimes HOT 8
- STATUS_LOGON_FAILURE HOT 6
- Unable to get accurate acl from Security Descriptor HOT 5
- Any way to list shares of an SMB server after creating session? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smbprotocol.