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
[source]¶ Address of a machine on a network.
-
family
= None¶ Address family (AF_INET or AF_INET6)
-
-
exception
py2neo.wiring.
BrokenWireError
(*args, **kwargs)[source]¶ Raised when a connection is broken by the network or remote peer.
-
class
py2neo.wiring.
Wire
(s, on_broken=None)[source]¶ Buffered socket wrapper for reading and writing bytes.
-
broken
¶ Flag indicating whether this connection has been closed remotely.
-
closed
¶ Flag indicating whether this connection has been closed locally.
-
classmethod
open
(address, timeout=None, keep_alive=False, on_broken=None)[source]¶ Open a connection to a given network
Address
.Parameters: - address –
- timeout –
- keep_alive –
- on_broken – callback for when the wire is broken after a successful connection has first been established (this does not trigger if the connection never opens successfully)
Returns: Wire
objectRaises: WireError – if connection fails to open
-