circuits.net.sockets module

Socket Components

This module contains various Socket Components for use with Networking.

class circuits.net.sockets.Client(bind=None, bufsize=4096, channel='client', **kwargs)

Bases: circuits.core.components.BaseComponent

channel = 'client'
close()
connected
parse_bind_parameter(bind_parameter)
socket_family = 2
socket_options = []
socket_protocol = 0
socket_type = 1
write(data)
circuits.net.sockets.Pipe(*channels, **kwargs)

Create a new full duplex Pipe

Returns a pair of UNIXClient instances connected on either side of the pipe.

class circuits.net.sockets.Server(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.core.components.BaseComponent

channel = 'server'
close(sock=None)
connected
host
parse_bind_parameter(bind_parameter)
port
socket_protocol = 0
starttls(sock)
write(sock, data)
class circuits.net.sockets.TCP6Client(bind=None, bufsize=4096, channel='client', **kwargs)

Bases: circuits.net.sockets.TCPClient

parse_bind_parameter(bind_parameter)
socket_family = 10
class circuits.net.sockets.TCP6Server(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.net.sockets.TCPServer

parse_bind_parameter(bind_parameter)
socket_family = 10
class circuits.net.sockets.TCPClient(bind=None, bufsize=4096, channel='client', **kwargs)

Bases: circuits.net.sockets.Client

connect(host, port, secure=False, **kwargs)
init(connect_timeout=5, *args, **kwargs)
socket_family = 2
socket_options = [(6, 1, 1)]
socket_protocol = 6
socket_type = 1
class circuits.net.sockets.TCPServer(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.net.sockets.Server

parse_bind_parameter(bind_parameter)
socket_family = 2
socket_options = [(1, 2, 1), (6, 1, 1)]
socket_type = 1
circuits.net.sockets.UDP6Client

alias of UDP6Server

class circuits.net.sockets.UDP6Server(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.net.sockets.UDPServer

parse_bind_parameter(bind_parameter)
socket_family = 10
circuits.net.sockets.UDPClient

alias of UDPServer

class circuits.net.sockets.UDPServer(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.net.sockets.Server

broadcast(data, port)
close()
socket_family = 2
socket_options = [(1, 6, 1), (1, 2, 1)]
socket_type = 2
write(address, data)
class circuits.net.sockets.UNIXClient(bind=None, bufsize=4096, channel='client', **kwargs)

Bases: circuits.net.sockets.Client

connect(path, secure=False, **kwargs)
ready(component)
socket_family = 1
socket_options = []
socket_type = 1
class circuits.net.sockets.UNIXServer(bind, secure=False, backlog=5000, bufsize=4096, channel='server', **kwargs)

Bases: circuits.net.sockets.Server

socket_family = 1
socket_options = [(1, 2, 1)]
socket_type = 1
circuits.net.sockets.do_handshake(sock, on_done=None, on_error=None, extra_args=None)

SSL Async Handshake

Parameters:
  • on_done – Function called when handshake is complete
  • on_error – Function called when handshake errored
circuits.net.sockets.parse_ipv4_parameter(bind_parameter)
circuits.net.sockets.parse_ipv6_parameter(bind_parameter)