Communication Methods (over sockets) for all client/server communication

Registered by Neal Bussett

Fully specify the methods by which the various programs that make up 'buntustand will communicate. The three components are the server, the burners, and the various display and control frontends.

Blueprint information

Status:
Started
Approver:
Neal Bussett
Priority:
Essential
Drafter:
Neal Bussett
Direction:
Approved
Assignee:
'Buntu Stand Team
Definition:
Discussion
Series goal:
Accepted for trunk
Implementation:
Started
Milestone target:
milestone icon scale8x
Started by
Neal Bussett

Related branches

Sprints

Whiteboard

On Connect (client connects to server)
Server: Client ID
 Client: Reply with something identifiable (MAC+device path md5 hashed, allows multiple clients per computer), Type of client
 #### IF BURNER ####
Server: Burn Capabilities?
 what ISOs it has, CD/DVD burner
 Client: Status of CD
Server: BURN [CD]
 Client: Status 0%
 Client: Status 50%
 Client: Status 100%
 Client: Status MD5-pass/fail (this is completion of this disk)
 ((client unmounts so tray can open)) -- Possibly pops tray open itself
 Client: Status Tray Open
 Client: Status AVAIL/EMPTY (repeat occassionally?)

 #### CD INFO QUERY #### (server query client, display/command query server)
HOST: WHAT\t[HASH]\r\n\r\n
CHILD: INFO\t[HASH]\t[filename]\t[description]\r\n\r\n

 #### CD TRANSFER ####
push/get (server pushes CDs to client, server gets CDs from client, command/display to server too)

 #### IF DISPLAY ####
 *display queue
 *display current status of all burners
 *statistics?
 -- *display current disk cache (burned disks we think we have?)

 #### IF COMMAND #### (all commands are also diplays?)
 *Queue a disk
 *Clear the queue
 *Method to match clients (UIDs) with physical computers (likely forcing trays to open, etc?)
 --- * This can also be determined just with normal usage, client X is done burning, and the tray is opened programmatically
 --- * Command should be able to send server a "Friendly" name for each burner which it will give to all displays

####################### Implementations #######################

Convention:
tabs as delimiters
messages ended by two CRLF (this allows freeflow descriptions... if you need a blank line, use "\r\n \r\n"

## Formats:
HASH: md5 hash of images
ID: unique identification of client software
   * Could use UUID (random)
   * Would be used to keep track of clients even if they drop connection (box X burned 10 CDs! or in the future: box X burns slowly and unreliably, only give him commodity images)

## New Connection ##
SERVER: IDENT\tV[version]\r\n\r\n # Ask for identification
CLIENT: ID\tV[version]\t(BURNCDR|BURNDVD|DISPLAY|COMMAND|SERVER)\t[ID]\r\n\r\n # Report back what type of client we are

HOST: CAPAB\r\n\r\n # Query for capabilities (for all)
CHILD: CAP\t(BURNCDR|BURNDVD|DISPLAY|COMMAND|SERVER)(\t[HASH])*\r\n\r\n # Report back what type of client, and all of the hashes (isos) we have

## Burn specific ##
{
{
CLIENT: STATUS\t(CDR|DVD)\t(AVAIL|EMPTY)\r\n\r\n # Type is really only needed when drive can do either (this type of disk, not drive)
 (wait for a bit (10 seconds right now), repeat until BURN)
}+
SERVER: BURN\t[HASH]\r\n\r\n
BURNER: STATUS\t[HASH]\t0\r\n\r\n # Burn has started
BURNER: STATUS\t[HASH]\t25\r\n\r\n
BURNER: STATUS\t[HASH]\t50\r\n\r\n
BURNER: STATUS\t[HASH]\t75\r\n\r\n
BURNER: STATUS\t[HASH]\t100\tTIME\t[time]\r\n\r\n # Time burn took (from 0 to 100 percent), time in seconds
BURNER: STATUS\t[HASH]\t(PASS|FAIL)\r\n\r\n # Good burn or bad burn
SERVER: OPEN\r\n\r\n # Optional, allow server to open tray
BURNER: STATUS\t(CDR|DVD)\tOPEN\r\n\r\n # Whether commanded, or button push
}+

## CD INFO QUERY ## (server query client, display/command query server)
## Client need not answer right away
HOST: WHATIS\t[HASH]\r\n\r\n
CHILD: INFO\t[HASH]\t[filename]\t[description]\r\n\r\n

## Error Messages ##
ERROR\t[short-err]\t[longerr]\r\n\r\n

## Client / Server ##
CLIENT: QUEUE\tHASH\tPRIORITY\r\n\r\n
SERVER: QOK\r\n\r\n

## Give us the Queue
CLIENT: QREPORT
SERVER: QLIST\t([ItemID]\t[HASH]\t[PRIORITY]\r\n)+\r\n

## Report the Statuses of burners
CLIENT: SREPORT
SERVER: SLIST\t([HASH]\t[STATUS]\r\n)+\r\n

## Deal with client-introduced-ISOs
CLIENT: ASKCAPAB
SERVER: capabilities like up there ^^ (Host/child new connection stuff)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.