Internal Messages

jWebSocket proprietary messages specification

The jWebSocket framework is built-in on top of the WebSocket protocol, in consequence any standard client can exchange messages with the jWebSocket server. However is important to mention that some proprietary messages are used in the jWebSocket framework related to it fragmentation and "packet delivery acknowledge" mechanism.

The messages are the follows:

  • "maxframesize" + number: Example "maxframesize2048". The max frame size message is sent from the server to the client at the beginning of a connection. It is the result of the negotiation of the "maxframesize" argument sent by the client in the connection URL ("ws://localhost:8787/jWebSocket/jWebSocket;maxframesize=2048") and the max frame size value of the engine that processed the connection:

    <engine>
      <name>org.jwebsocket.tcp.TCPEngine</name>
      <id>tcp0</id>
      <jar>jWebSocketTCPEngine-1.0.jar</jar>
      <port>8787</port>
      <sslport>9797</sslport>
      <keystore>${JWEBSOCKET_HOME}conf/jWebSocket.ks</keystore>
      <password>jWebSocket</password>
      <domains>
        <domain>*</domain>
      </domains>
      <timeout>0</timeout>
      <maxframesize>1048840</maxframesize>
      <maxconnections>10000</maxconnections>
      <onmaxconnections>reject</onmaxconnections>
    </engine>
    

    See "jWebSocket Fragmentation model: The client and server "maximum frame size" handshake" section for more details.

  • number + ",": Example "12,". The packet identifier prefix is set for all bidirectional messaging between the client and the server, it is used to support the packet delivery acknowledge mechanism. The sender side mark it packets with a unique identifier and in consequence the receptor side must answer with the receiving confirmation. See below.

  • "pda" + number. Example: "pda2". The packet delivery acknowledge message is sent from the receptor side when a packet has been received. The message is composed by the prefix "pda" and the unique identifier of the received packet. See above.

  • "FRAGMENT" + number + ",". Example: "FRAGMENT1,". The fragmentation information prefix is set for all bidirectional fragmented messages. The message is composed by the prefix "FRAGMENT" and the unique packet identifier, it indicates that the packet is a fragment. In order to support multiplexing, multiple fragments from different packets can arrive to the server or the client, but they are logically organized in a storage using the unique packet identifier number.

  • "LFRAGMENT" + number + ",". Example: "LFRAGMENT1,". The last fragment information prefix is set for all bidirectional last message fragments. The message is composed by the prefix "LFRAGMENT" and the unique packet identifier, it indicates that the packet is the last fragment of a packet fragmentation.

Copyright © 2013 Innotrade GmbH. All rights reserved.