Native Session-Based Chat Protocol

For applications that wish to have bi-directional communication, FME Server supports a session based “chat” protocol. This protocol leverages FME Server's native WebSocket support.

Supported clients include, among others, the following HTML5-based web browsers:

  • Internet Explorer 10+
  • Firefox 11+
  • Chrome 16+
  • Safari 6+
  • Opera 12.10+

Note: By default, FME Server uses port 7078 for WebSocket communication. If necessary, be sure to configure any firewall settings to allow for open communication on port 7078.

The "chat" protocol sends messages to all recipients with the same <sessionkey> value. In the above example, the bi-directional arrows in black indicate session key “black”, and the bi-directional arrows in red indicate session key “red”. Clients A, B and C can communicate with each other because they have the same chat session key. Clients D and E can communicate with each other because they have the same chat session key.

The chat_open message operation establishes a session-based chat session.

{

ws_op : chat_open,

ws_sessionkey : <sessionkey>

}

The chat_send message operation sends messages to all chat clients.

{

ws_op : chat_send,

ws_sessionkey : <sessionkey>,

ws_msg : <msg>

}

The recipients of the chat_send operation receive message with the following schema:

{

ws_msg : <msg>

}

The chat_close operation removes the client from the chat session.

{

ws_op : chat_close,

ws_sessionkey : <sessionkey>

}

Note: If chat_close is not invoked, the WebSocket server cleans connections when it receives the channel closed event.

See Also