Adding more packet headers

This commit is contained in:
Philip Rosedale 2013-04-08 19:03:49 -07:00
parent 6f8808e565
commit 06a5e4d8a9
2 changed files with 6 additions and 2 deletions

View file

@ -69,12 +69,12 @@ unsigned int AgentList::getSocketListenPort() {
void AgentList::processAgentData(sockaddr *senderAddress, void *packetData, size_t dataBytes) {
switch (((char *)packetData)[0]) {
case 'D': {
case PACKET_HEADER_DOMAIN: {
// list of agents from domain server
updateList((unsigned char *)packetData, dataBytes);
break;
}
case 'H': {
case PACKET_HEADER_HEAD: {
// head data from another agent
updateAgentWithData(senderAddress, packetData, dataBytes);
break;

View file

@ -5,6 +5,9 @@
// Created by Stephen Birarda on 4/8/13.
//
//
// The packet headers below refer to the first byte of a received UDP packet transmitted between
// any two Hifi components. For example, a packet whose first byte is 'P' is always a ping packet.
//
#ifndef hifi_PacketHeaders_h
#define hifi_PacketHeaders_h
@ -12,5 +15,6 @@
const char PACKET_HEADER_DOMAIN = 'D';
const char PACKET_HEADER_PING = 'P';
const char PACKET_HEADER_PING_REPLY = 'R';
const char PACKET_HEADER_HEAD = 'H';
#endif