hio.core.tcp.clienting
hio.core.tcp.clienting Module
Module Contents
Classes
Nonblocking TCP Socket Client Class. |
|
Outgoer with Nonblocking TLS/SSL support |
|
Basic TCP Client |
Functions
|
Wrapper to create and open TCP Client instances |
Attributes
- hio.core.tcp.clienting.openClient(cls=None, **kwa)[source]
Wrapper to create and open TCP Client instances When used in with statement block, calls .close() on exit of with block
- Parameters
instance (cls is Class instance of subclass) –
- Usage:
- with openClient() as client0:
client0.accept()
- with openClient(cls=ClientTls) as client0:
client0.accept()
- class hio.core.tcp.clienting.Client(tymeout=None, ha=None, host='127.0.0.1', port=56000, reconnectable=None, bs=8096, txbs=None, rxbs=None, wl=None, **kwa)[source]
Bases:
hio.base.tyming.TymeeNonblocking TCP Socket Client Class.
See tyming.Tymee for inherited attributes, properties, and methods
Attributes:
Properties:
Methods:
- property connected(self)[source]
Property that returns connected state of TCP socket Non-tls tcp is connected when accepted
- wind(self, tymth)[source]
Inject new tymist.tymth as new ._tymth. Changes tymist.tyme base. Updates winds .tymer .tymth
- reinitHostPort(self, ha=None, hostname='127.0.0.1', port=56000)[source]
Reinit self.ha and self.hostname from ha = (host, port) or hostname port self.ha is of form (host, port) where host is either dns name or ip address self.hostname is hostname as dns name host eventually is host ip address output from normalizeHost()
- actualBufSizes(self)[source]
Returns duple of the the actual socket send and receive buffer size (send, receive)
- open(self)[source]
Opens connection socket in non blocking mode.
- if socket not closed properly, binding socket gets error
OSError: (48, ‘Address already in use’)
- accept(self)[source]
Attempt nonblocking acceptance connect to .ha Returns True if successful Returns False if not so try again later
- connect(self)[source]
Attempt nonblocking connect to .ha Returns True if successful Returns False if not so try again later For non-TLS tcp connect is done when accepted This is placeholder for subclass Tls
- serviceConnect(self)[source]
Service connection attempt If not already connected make a nonblocking attempt Returns .connected
- receive(self)[source]
Perform non blocking receive from connected socket .cs
If no data then returns None If connection closed then returns empty Otherwise returns data data is string in python2 and bytes in python3
- send(self, data)[source]
Perform non blocking send on connected socket .cs. Return number of bytes sent data is string in python2 and bytes in python3
- class hio.core.tcp.clienting.ClientTls(context=None, version=None, certify=None, hostify=None, certedhost='', keypath=None, certpath=None, cafilepath=None, **kwa)[source]
Bases:
ClientOutgoer with Nonblocking TLS/SSL support Nonblocking TCP Socket Client Class.
Attributes:
Properties:
Methods:
- property connected(self)[source]
Property that returns connected state of TCP socket TLS tcp is connected when accepted and handshake completed
- handshake(self)[source]
Attempt nonblocking ssl handshake to .ha Returns True if successful Returns False if not so try again later
- connect(self)[source]
Attempt nonblocking connect to .ha Returns True if successful Returns False if not so try again later Connected when both accepted connection and TLS handshake complete
- class hio.core.tcp.clienting.ClientDoer(client, **kwa)[source]
Bases:
hio.base.doing.DoerBasic TCP Client
See Doer for inherited attributes, properties, and methods.
- .client is TCP Client instance