![]() ![]() V-type can be any of the types listed in this table.ĥ = type_info(Dictionary) + type_info(Object) + type_info(V) + length_size ĥ + photon_sizeof(keys) + photon_sizeof(values) - count(keys) * type_info(K) T-type can be any of the types listed in this table except byte.Ĥ = type_info(array) + type_info(T) + length_size ģ + photon_sizeof(keys) + photon_sizeof(values)ĥ + photon_sizeof(keys) + photon_sizeof(values)ĥ = type_info(Dictionary) + 2 * type_info(Object) + length_size ĭictionary keys should not be of type Dictionary.ĥ + photon_sizeof(keys) + photon_sizeof(values) - count(keys) * type_info(V) ![]() Type (C#)ģ + sizeof( UTF8.GetBytes(string_value) )Ĥ + photon_sizeof(elements) - length * type_info(T) The following types are generally supported and known by Photon's binary protocol.Īs some languages don't provide every listed type, some SDKs support less types. Its length is of type intĪnd it needs 4 bytes to store the length. This is because the type of the length is short.īyte array is the exception to this rule. All collections need 2 bytes to store their length.Strongly typed collections send the element type once instead of sending type_info per element.This is not the case for Hashtable, Object array and Byte array as the collection type is part of the type_info. Most collections need 1 extra byte for the type of the collection. ![]() Primitive types need 1 byte for type_info.On most client APIs, you can also register your custom serialization methods for other classes you might need.Įach Photon supported type needs some reserved bytes for the type_info. This is done automatically for a range of commonly used data types. Photon must convert all data into this binary protocol before it can be sent. Photon and its clients are using a highly optimized binary protocol to communicate. This makes the JavaScript SDKs have limited data types, at least compared to the other SDKs.Ĭonsider this especially if you want clients built with the JavaScript SDK to communicate with clients built with other SDKs. This page is not relevant for the JavaScript SDKs since they use JSON serialization and not the binary protocol. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |