Robot UDP Transmitter Protocol
The protocol sends all SAX events of HTML parser.
Protocol
- UDP
- server port port_s>1024
Initialization and run
- Client (IP_c:port_c) sends list of URL prefixes it wants to listen to, separated by a single space
- (if port_c!=port_s) Server responds to (IP_c:port_s) with "HELO" and the list of the recognized prefixes, the tokens are separated by "\n"
- Server emits all SAX events to (IP_c:port_c) for up to 30 seconds
If a client subscribes several times, the last subscription is valid only.
Shutdown
- Client sends from its original (IP_c:port_c) an empty packet
- Server responds with
- "BYE" if the client is known and was removed from the broadcast list
- "ERR" if the client is unknown to the server, so the unsubscribe operation was canceled
Events
Event format is:
- ID (4 bytes)
- global counter (4 bytes)
- sequential number of this event (4 bytes)
- command (2 bytes - interpreted as char)
- 'D' - document start, value then contains URI in ASCII
- 'd' - document end, value then contains URI in ASCII
- 'E' - element start
- 'e' - element end
- 'G' - general entity start
- 'g' - general entity end
- 'X' - empty element
- 'C' - comment
- 'T' - text
- 'a' - abort
- total number of fragments (4 bytes)
- fragment number (4 bytes)
- length of the value (4 bytes)
- value
Last item may be zero length.
One UDP packet may transfer several events.