raise IOError("cannot send to %r" %(self,))
self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
- def receive(self, timeout=-
+ def receive(self, timeout=):
"""receive a data item that was sent from the other side.
- timeout: -1 [default] blocked waiting, but wake up periodically
- to let CTRL-C through. A positive number indicates the
- number of seconds after which a channel.TimeoutError exception
- will be raised if no item was received.
+ timeout: None [default] blocked waiting. A positive number
+ indicates the number of seconds after which a channel.TimeoutError
+ exception will be raised if no item was received.
Note that exceptions from the remotely executing code will be
reraised as channel.RemoteError exceptions containing
a textual representation of the remote traceback.
raise IOError("cannot receive(), channel has receiver callback")
- internal_timeout = self._INTERNALWAKEUP
- internal_timeout = timeout
- x = itemqueue.get(timeout=internal_timeout)
- raise self.TimeoutError("no item after %r seconds" %(timeout))
+ x = itemqueue.get(timeout=timeout)
+ raise self.TimeoutError("no item after %r seconds" %(timeout))
itemqueue.put(x) # for other receivers
raise self._getremoteerror() or EOFError()