pybitmessage.network.tcp module

src/network/tcp.py

class Socks4aBMConnection(address)[source]

Bases: network.socks4a.Socks4aConnection, pybitmessage.network.tcp.TCPConnection

SOCKS4a wrapper for TCP connections

state_proxy_handshake_done()

State when SOCKS4a connection succeeds, we need to send a Bitmessage handshake to peer.

class Socks5BMConnection(address)[source]

Bases: network.socks5.Socks5Connection, pybitmessage.network.tcp.TCPConnection

SOCKS5 wrapper for TCP connections

state_proxy_handshake_done()

State when SOCKS5 connection succeeds, we need to send a Bitmessage handshake to peer.

class TCPConnection(address=None, sock=None)[source]

Bases: network.bmproto.BMProto, network.tls.TLSDispatcher

Todo

Look to understand and/or fix the non-parent-init-called

antiIntersectionDelay(initial=False)

This is a defense against the so called intersection attacks.

It is called when you notice peer is requesting non-existing objects, or right after the connection is established. It will estimate how long an object will take to propagate across the network, and skip processing “getdata” requests until then. This means an attacker only has one shot per IP to perform the attack.

handle_close()

Callback for connection being closed.

handle_connect()

Callback for TCP connection being established.

handle_read()

Callback for reading from a socket

handle_write()

Callback for writing to a socket

sendAddr()

Send a partial list of known addresses to peer.

sendBigInv()

Send hashes of all inventory objects, chunked as the protocol has a per-command limit.

set_connection_fully_established()

Initiate inventory synchronisation.

state_connection_fully_established()

State after the bitmessage protocol handshake is completed (version/verack exchange, and if both side support TLS, the TLS handshake as well).

class TCPServer(host='127.0.0.1', port=8444)[source]

Bases: network.advanceddispatcher.AdvancedDispatcher

TCP connection server for Bitmessage protocol

handle_accept()

Incoming connection callback

is_bound()

Is the socket bound?

bootstrap(connection_class)[source]

Make bootstrapper class for connection type (connection_class)