Package brisa :: Package core :: Module network_senders :: Class TCPTransport
[hide private]
[frames] | no frames]

Class TCPTransport

source code

object --+
         |
        TCPTransport

Provides methods for sending data through TCP. Receiving host must be listening for connections.

Instance Methods [hide private]
 
__init__(self)
Constructor for the TCPTransport class.
source code
 
send_data(self, data, (host, port))
Sends data to the specified address.
source code
 
_send_data(self, data, (host, port))
Sends data to the specified address (implementation).
source code
 
connect_and_feed(self, feeder, (host, port))
Connects to the specified address and feeds it with data from the feeder.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor for the TCPTransport class.

Overrides: object.__init__

send_data(self, data, (host, port))

source code 

Sends data to the specified address. This is a non-blocking method.

Parameters:
  • data (string) - raw data
  • host (string) - target host
  • port (integer) - target port

_send_data(self, data, (host, port))

source code 

Sends data to the specified address (implementation). If used directly will block the thread until it is complete.

connect_and_feed(self, feeder, (host, port))

source code 

Connects to the specified address and feeds it with data from the feeder. Note that feeder is supposed to be a generator.

Parameters:
  • feeder (generator) - data generator for feeding
  • host (string) - target host
  • port (integer) - target port