net.defaults package

Submodules

net.defaults.flags module

Default Flags

Prebuilt flags for net. Do not modify.

net.defaults.flags.null_response(connection, foreign_peer_id)[source]

Execute this if the peer has returned the NULL_RESPONSE flag.

Parameters:
  • connection – name of the connection requested
  • foreign_peer_id – The foreign peers friendly_id
Returns:

str

net.defaults.flags.invalid_connection(connection, foreign_peer_id)[source]

Execute this if the peer has returned the NULL_RESPONSE flag.

Parameters:
  • connection – name of the connection requested
  • foreign_peer_id – The foreign peers friendly_id
Returns:

net.defaults.handlers module

Default Connected Handlers

Prebuilt connected handlers for net. Do not modify.

net.defaults.handlers.info(*args, **kwargs)[source]

Return information about the peer requested.

friendly_information = net.info(peer='somepeer')
Returns:peer.friendly_id
net.defaults.handlers.pass_through(*args, **kwargs)[source]

Used for testing, takes your arguments and passes them back for type testing.

variable = "Test this comes back the way I sent it."

response = net.pass_through(variable, peer='somepeer')
Returns:*args, **kwargs
net.defaults.handlers.null(*args, **kwargs)[source]

Return a null response flag

Returns:NULL Flag
net.defaults.handlers.subscription_handler(event, peer, connection)[source]

Will register the incoming peer and connection with the local peers subscription of the event passed. This is for internal use only.

Parameters:
  • event – event id
  • peer – foreign peer id
  • connection – connection id
net.defaults.handlers.connections(*args, **kwargs)[source]

Return the connections registered with the peer.

friendly_information = net.connections(peer='somepeer')
Returns:peer.CONNECTIONS

Module contents