This is an abstract class, you must derive from this class and add
these methods:
onConnect() - called when a connection has been established
onClose() - called when the connection has been lost
onData(data) - called when the entire data packet has arrived
(there is no trailing null terminator)
The initialization method accepts two parameters: host, and port.
It will attempt to make a socket connection to the specified host,
on the specified port. Pretty obvious behavior.
Methods
|
|
__init__
collect_incoming_data
found_terminator
handle_close
handle_connect
log
push
|
|
__init__
|
__init__ (
self,
host,
port,
)
|
|
collect_incoming_data
|
collect_incoming_data ( self, data )
|
|
found_terminator
|
found_terminator ( self )
|
|
handle_close
|
handle_close ( self )
call when you want to close the connection
|
|
handle_connect
|
handle_connect ( self )
|
|
log
|
log ( self, *ignore )
|
|
push
|
push ( self, data )
pushes a data packet to the server, null termination is automatic
|
|