Changes between Version 8 and Version 9 of Software/Gateway


Ignore:
Timestamp:
08/31/10 18:10:28 (14 years ago)
Author:
art
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Software/Gateway

    v8 v9  
    115115}}} 
    116116 
    117 Every message sent over the network and to/from the server must have this form. Here ''x'' indicates reserved/non-used bytes. ''src'' and ''dst'' are the IBus-Device ids for source and destination respectively. ''len'' indicates the amount of bytes passed in the data field. Data field can be send in another TCP frame or together with the header. ''priority'' sets the priority of a message to be sent over IBus.  
     117Every message sent over the network and to/from the server must have this form. Here ''x'' indicates reserved/non-used bytes. ''src'' and ''dst'' are the IBus-Device identifiers (i.e. 0x18 for CD-Changer, 0x00 for GM, 0x68 for Radio, etc...) for source and destination respectively. ''len'' indicates the amount of bytes passed in the data field. Data field can be send in another TCP frame or together with the header. ''priority'' sets the priority of a message to be sent over IBus.  
    118118 
    119119There are also exists special messages sent between server and the client. This special messages are required for establishing communication and checking if client is still alive for example. Every message in which header ''len'' is set to 0, is a special message. There are currently existing following special message types: 
     
    124124  * '''Disconnect''': ''src=0'', ''dst=0'' - is sent by a client to the server, to indicate that client is disconnecting. Server will free resources and mark the used port as free again. 
    125125  
     126To establish communication between a client and OpenBM-Gateway server following steps has to be done: 
     127 1. Client opens a socket to server's IP-address and port (i.e. 127.0.0.1:4287) 
     128 2. Client send '''Hello''' message and wait for replay from server for 3-5 seconds  
     129 3. React depending on situation: 
     130    * server did not responded -> server is busy 
     131    * server response with '''Disconnect''' -> there are no free client slots available 
     132    * server response with '''Connect''' -> client's socket has to reconnect to the port received in the ''priority'' field of '''Connect''' message 
     133 4. If connection established, client send every 3 seconds '''Ping''' message 
     134 5. Server responses with '''Ping''' message 
     135 6. If server didn't responded, client retries to send a '''Ping''' next two times. If still no response -> connection died 
     136 7. In order to stop connection, client send '''Disconnect''' message and closes its socket. 
     137 
    126138 
    127139=== Server ===