git-svn-id: svn://db.shs.com.ru/libs@125 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-09-26 17:17:54 +00:00
parent a8289c1ee6
commit 125158f243
8 changed files with 56 additions and 20 deletions

View File

@@ -9,15 +9,15 @@ enum CDPacketType {CD_Ping, CD_Pong, CD_KQuery, CD_KSend, CD_Command, CD_XData,
# pragma pack(push,1)
struct PacketHeader {
int session_id;
int type; // CDPacketType
int session_id;
};
# pragma pack(pop)
inline PIByteArray & operator <<(PIByteArray & s, const PacketHeader & v) {s << v.session_id << v.type; return s;}
inline PIByteArray & operator >>(PIByteArray & s, PacketHeader & v) {s >> v.session_id >> v.type; return s;}
inline PIByteArray & operator <<(PIByteArray & s, const PacketHeader & v) {s << v.type << v.session_id; return s;}
inline PIByteArray & operator >>(PIByteArray & s, PacketHeader & v) {s >> v.type >> v.session_id; return s;}
}