Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As long as you can write a specification for the data you send through the TCP socket, you've got your own protocol.</p> <p>It's mostly about defining commands and payloads. You've got to serialize your command packet before putting them through TCP. Endianness is a common pitfall if you pack the packet in <em>binary format</em>. XML and JSON are common <em>text-based</em> data exchange formats. Personally I'm pro-JSON.</p> <p>Do refer to <a href="http://bsonspec.org/" rel="nofollow noreferrer">BSON</a>, <a href="https://msgpack.org/" rel="nofollow noreferrer">MessagePack</a> or <a href="https://github.com/google/protobuf" rel="nofollow noreferrer">protobuf</a> for binary serialization. They pack the <strong>typed</strong> data into binary so they have better type checking than text based serialization and more compact in size. They also handle endian conversion, packet versioning and provide drivers/bindings in various languages. The server and client could have been written in different languages.</p> <p><strong>EDIT: added RFC samples</strong></p> <p>Seeing the comment by Ross Patterson, I also recommend reading RFC for protocol definition references. <a href="http://tools.ietf.org/html/rfc2326" rel="nofollow noreferrer">RTSP</a> and <a href="http://tools.ietf.org/html/rfc2616" rel="nofollow noreferrer">HTTP</a> are text protocols, <a href="http://tools.ietf.org/html/rfc3550" rel="nofollow noreferrer">RTP</a> and media formats (<a href="http://tools.ietf.org/html/rfc3640" rel="nofollow noreferrer">MPEG4 AV</a>, <a href="http://tools.ietf.org/html/rfc6184" rel="nofollow noreferrer">H-264</a>) are binary protocols.</p> <p><strong>EDIT:</strong></p> <p><a href="http://www.infoq.com/interviews/protocol-serialization-todd-montgomery" rel="nofollow noreferrer">Demystifying Protocols and Serialization Performance with Todd Montgomery</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload