Quilt Protocol Object

class quilt.protocol.QuiltProtocol(addr, port)
connect_to_server(server, port)

Connect to a server

Parameters:
  • server (str) – server address
  • port (int) – port number of the server
handle(message)

Handler method recieves a message and decided how to deal with it The protocol is split into parts: [destination, cmd, args...] Destination options are: all or a single server :type message: list :param message: a list of data recieved from a zeromq recv_multipart

handle_ping(args)

Handle a ping from an incoming server format is [ping, sender] response is [pong, ourname]

Parameters:args (list) – A list of arguments for this command
handle_server_connect(args)

Handle an incoming server connect, the incoming server sends us server-connect and then we do things like connect back to them args should look like this: [address, port]

Parameters:args (list) – A list of args that are recieved from the server
ping_server(server)

Ping a specific server Next step in this implementation is to allow for pinging servers we are not directly connected to, this involves routing

Parameters:server (str) – The server to ping

Project Versions

Previous topic

Quilt

This Page