Skip to content
Matthew Dawson edited this page Apr 11, 2013 · 2 revisions

The web socket interface provides a push/pull system to allow for easy communication between the front end and the backend. All requests have a similar message structure. Currently the system does not handle disconnections gracefully. The intention would be for the session to be automatically resumed when the client detects failure, and the server to hold onto a reasonable backlog of messages, or drop the connection if unavoidable.

Low Layer protocol.

Requests

Requests from the client have the following structure:

struct msg {
	msg_id uint32
	op_path string
	op string
	data object
}

msg_id represents what request this is. It allows for the backend to handle multiple requests asynchronously. msg_id is returned with the answer, and all packets receive an answer.

###Response

struct msg {
	msg_id
	data object
}

This has inside of it all the necessary details for the response. The contents of data is request specific. msg_id relates it to the original request.

###Push

struct msg {
	path_notice string
	data object
}

When the client is listening to something, this response is sent. path_notice contains the path relevant to the data passed down.

For now all the data objects are undefined. If common elements begin appearing in the prototype, it may become more specified.

Clone this wiki locally