r6 - 17 May 2007 - 00:34:43 - LeoGalambosYou are here: TWiki >  Egothor Web  > TransmitterProtocol

Robot UDP Transmitter Protocol

The protocol sends all SAX events of HTML parser.

Protocol

  • UDP
  • server port port_s>1024

Initialization and run

  1. Client (IP_c:port_c) sends list of URL prefixes it wants to listen to, separated by a single space
  2. (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"
  3. 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

  1. Client sends from its original (IP_c:port_c) an empty packet
  2. 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.

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 < r5 < r4 < r3 < r2 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback