nmb_NBNSProtocol.rst @f01d0db4-7e9d-4af8-b8eb-c54efefdacbf/main — view markup · raw · history · blame
NBNSProtocol Class
pysmb has a NBNSProtocol implementation for Twisted framework. This allows you to perform name query asynchronously without having your application to block and wait for the results.
- In your project,
- Create a NBNSProtocol instance.
- Just call queryName method which will return a Deferred instance. Add your callback function to the Deferred instance via addCallback method to receive the results of the name query.
- When you are done with the NBNSProtocol instance, call its <NBNSProtocol instance>.transport.stopListening method to remove this instance from the reactor.