py2neo.wiring – Low-level network operations

Low-level module for network communication.

This module provides a convenience socket wrapper class (Wire) as well as classes for modelling IP addresses, based on tuples.

class py2neo.wiring.Address(iterable)[source]

Address of a machine on a network.

family = None

Address family (AF_INET or AF_INET6)

class py2neo.wiring.IPv4Address(iterable)[source]

Address subclass, specifically for IPv4 addresses.

class py2neo.wiring.IPv6Address(iterable)[source]

Address subclass, specifically for IPv6 addresses.

class py2neo.wiring.Wire(s)[source]

Buffered socket wrapper for reading and writing bytes.

property broken

Flag indicating whether this connection has been closed remotely.

close()[source]

Close the connection.

property closed

Flag indicating whether this connection has been closed locally.

property local_address

The local Address to which this connection is bound.

classmethod open(address, timeout=None, keep_alive=False)[source]

Open a connection to a given network Address.

read(n)[source]

Read bytes from the network.

property remote_address

The remote Address to which this connection is bound.

secure(verify=True, hostname=None)[source]

Apply a layer of security onto this connection.

send()[source]

Send the contents of the output buffer to the network.

write(b)[source]

Write bytes to the output buffer.

exception py2neo.wiring.WireError[source]

Raised when a connection error occurs.