Peach :: Publishers :: tcp :: Tcp :: Class Tcp
[hide private]

Class Tcp

source code


A simple TCP client publisher.

Instance Methods [hide private]
 
__init__(self, host, port, timeout=0.25) source code
 
start(self) source code
 
stop(self) source code
 
connect(self)
Create connection.
source code
 
close(self)
Close connection if open.
source code
 
send(self, data)
Send data via sendall.
source code
string
_receiveBySize(self, size)
This is now a buffered receiver.
source code
string
_receiveByAvailable(self)
Receive as much as possible prior to timeout.
source code
 
receive(self, size=None) source code
Method Details [hide private]

__init__(self, host, port, timeout=0.25)
(Constructor)

source code 
Parameters:
  • host (string) - Remote host
  • port (number) - Remote port
  • timeout (number) - How long to wait for reponse

send(self, data)

source code 

Send data via sendall.

Parameters:
  • data (string) - Data to send

_receiveBySize(self, size)

source code 

This is now a buffered receiver.

Returns: string
received data.

_receiveByAvailable(self)

source code 

Receive as much as possible prior to timeout.

Returns: string
received data.