From fd73b8de82572a81707f20c2bd86be81fb7c3bc9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 18 Feb 2013 09:50:15 -0800 Subject: [PATCH] always store ports as unsigned short ports --- domain/src/main.cpp | 4 ++-- interface/src/Agent.h | 2 +- interface/src/main.cpp | 4 ++-- mixer/src/main.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/domain/src/main.cpp b/domain/src/main.cpp index eb23eac51f..75eebbb9af 100644 --- a/domain/src/main.cpp +++ b/domain/src/main.cpp @@ -43,9 +43,9 @@ struct AgentList { char agentType; uint32_t ip; in_addr public_sin_addr; - in_port_t public_port; + unsigned short public_port; char *private_addr; - in_port_t private_port; + unsigned short private_port; float x, y, z; bool active; timeval time, connectTime; diff --git a/interface/src/Agent.h b/interface/src/Agent.h index 15a363bb12..460491fde7 100644 --- a/interface/src/Agent.h +++ b/interface/src/Agent.h @@ -19,7 +19,7 @@ #include "UDPSocket.h" #include "Audio.h" -const int AGENT_UDP_PORT = 40103; +const unsigned short AGENT_UDP_PORT = 40103; int update_agents(char * data, int length); int add_agent(char * address, unsigned short port, char *private_address, unsigned short private_port, char agentType); diff --git a/interface/src/main.cpp b/interface/src/main.cpp index a42c06d6c1..ef875a3d5a 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -60,7 +60,7 @@ int simulate_on = 1; const int MAX_PACKET_SIZE = 1500; char DOMAIN_HOSTNAME[] = "highfidelity.below92.com"; -char DOMAIN_IP[100] = ""; // IP Address will be used first if not empty string +char DOMAIN_IP[100] = "192.168.1.47"; // IP Address will be used first if not empty string const int DOMAINSERVER_PORT = 40102; UDPSocket agentSocket(AGENT_UDP_PORT); @@ -231,7 +231,7 @@ void Timer(int extra) // Send a message to the domainserver telling it we are ALIVE // char output[100]; - sprintf(output, "%c %f,%f,%f,%s %hd", 'I', location[0], location[1], location[2], localAddressBuffer, (unsigned short) AGENT_UDP_PORT); + sprintf(output, "%c %f,%f,%f,%s %hd", 'I', location[0], location[1], location[2], localAddressBuffer, AGENT_UDP_PORT); std::cout << "sending " << output << " to domain server\n"; int packet_size = strlen(output); agentSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packet_size); diff --git a/mixer/src/main.cpp b/mixer/src/main.cpp index 011e27f82b..5f4605fac3 100644 --- a/mixer/src/main.cpp +++ b/mixer/src/main.cpp @@ -18,7 +18,7 @@ const int MAX_AGENTS = 1000; const int LOGOFF_CHECK_INTERVAL = 1000; -const int MIXER_LISTEN_PORT = 55443; +const unsigned short MIXER_LISTEN_PORT = 55443; const int BUFFER_LENGTH_BYTES = 1024; const int BUFFER_LENGTH_SAMPLES = BUFFER_LENGTH_BYTES / sizeof(int16_t); @@ -229,7 +229,7 @@ void *reportAliveToDS(void *args) { while (true) { gettimeofday(&lastSend, NULL); - sprintf(output, "%c %f,%f,%f,54.241.92.53 %hd", 'M', 0.f, 0.f, 0.f, (unsigned short)MIXER_LISTEN_PORT); + sprintf(output, "%c %f,%f,%f,54.241.92.53 %hd", 'M', 0.f, 0.f, 0.f, MIXER_LISTEN_PORT); int packetSize = strlen(output); audioSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packetSize);