MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / echo

Method echo

pager_lib/smb/SMBProtocol.py:378–391  ·  view source on GitHub ↗

Send an echo command containing *data* to the remote SMB/CIFS server. The remote SMB/CIFS will reply with the same *data*. :param bytes data: Data to send to the remote server. Must be a bytes object. :param integer/float timeout: Number of seconds that pysmb will wait befo

(self, data, timeout = 10)

Source from the content-addressed store, hash-verified

376 return d
377
378 def echo(self, data, timeout = 10):
379 """
380 Send an echo command containing *data* to the remote SMB/CIFS server. The remote SMB/CIFS will reply with the same *data*.
381
382 :param bytes data: Data to send to the remote server. Must be a bytes object.
383 :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance's *errback* method.
384 :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with the *data* parameter.
385 """
386 if not self.instance:
387 raise NotConnectedError('Not connected to server')
388
389 d = defer.Deferred()
390 self.instance._echo(data, d.callback, d.errback, timeout)
391 return d
392
393 def closeConnection(self):
394 """

Callers

nothing calls this directly

Calls 1

NotConnectedErrorClass · 0.70

Tested by

no test coverage detected