Protocols

Overview

In version 3.0, the protocol part of the code logic has been separated into a distinct dynamic library called ProtocolFramework. Push Framework is dependent on this library. Therefore protocol implementation can be done separately from specific server logic and the same implementation can be reused in other servers by other people. It is even possible to imagine a scenario where the same protocol implementation is used by the client side application, if it is in C++, since most protocols are symetric.

MessageFactory Vs Protocol

Message serialization has become a task separate from protocol logic. This design change has allowed the restoration of the very old feature of supporting multiple protocols through the same server by listening one multiple ports.

Protocol only cares about transforming content. It never looks at structured messages. Message serializer will look after structured message objects and hand them over to the protocol stack in form of content bytes. Per server, you can only have one message serializer, unlike protocols: you can have many ports, each port can be bound to a chained list of protocols (protocol stack).

Available Serializers

  • XML Serializer

This serializer allows incoming messages and outgoing messages to be structured as XML trees. When incoming request arrives, your business code will read an XML node object. When composing outgoing responsers, you can pass XML nodes and the serializer will make the needed job of transforming into bytes.

  • Protobuf.

Google Protobuf is a fast binary serialization library. ProtobufSerializer class can be used with Push Framework so you take benefits from this great tool.

  • JSonSerializer

JSon has become a well known data format, especially with the web. JsonSerializer will use the C++ Jsonlib library to allow you the easy integration with Push Framework. This is a perfect choice when you are talking to web clients using Websocket protocol.

Available Protocols

  • Websocket Protocol

You can use WebsocketProtocol class to be able to talk with latest browsers implementing Websocket. Using a C++ backend along with a Web front end can be a clever idea in some situations in order to win over competition.

  • SSLProtocol

You use this protocol to encrypt your communication. You can use it standalone, or you can wire it to an existing protocol to add a TLS layer for it.

  • Simple Protocol

This a demo protocol for developer who want to learn new protocol development and do not want to be confused by reading complex implementations.

Custom Protocol Development

Do you want a particular protocol implementation ? Do not hesitate to ask for it.

 

 

Share