From ecc7eee161588630df17678d1b340088a8762342 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 13 Feb 2013 10:53:03 -0800 Subject: [PATCH] changed to EC2 domain server by default in interface, increased domain server keep alive timeout to 5 seconds. --- domain/src/main.cpp | 19 +++++++++++++------ interface/src/main.cpp | 9 ++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/domain/src/main.cpp b/domain/src/main.cpp index f514ca25e5..f31f9028da 100644 --- a/domain/src/main.cpp +++ b/domain/src/main.cpp @@ -5,8 +5,17 @@ // Created by Philip Rosedale on 11/20/12. // Copyright (c) 2012 High Fidelity, Inc. All rights reserved. // -// The Domain Server -// +// The Domain Server keeps a list of agents that have connected to it, and echoes that list of +// agents out to agents when they check in. +// +// The connection is stateless... the domain server will set you inactive if it does not hear from +// you in LOGOFF_CHECK_INTERVAL milliseconds, meaning your info will not be sent to other users. +// +// Each packet from an agent has as first character the type of server: +// +// I - Interactive Agent +// M - Audio Mixer +// #include #include @@ -19,10 +28,8 @@ #include #include -// Domain server listens for packets on this port number + const int LISTENING_UDP_PORT = 40102; - - const char DESTINATION_IP[] = "127.0.0.1"; sockaddr_in address, dest_address; socklen_t destLength = sizeof( dest_address ); @@ -32,7 +39,7 @@ const int MAX_PACKET_SIZE = 1500; char packet_data[MAX_PACKET_SIZE]; const int MAX_AGENTS = 1000; -const int LOGOFF_CHECK_INTERVAL = 2000; +const int LOGOFF_CHECK_INTERVAL = 5000; struct AgentList { char agentType; diff --git a/interface/src/main.cpp b/interface/src/main.cpp index dc8fcc25df..6da7623880 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -56,7 +56,7 @@ int simulate_on = 1; // const int MAX_PACKET_SIZE = 1500; -char DOMAINSERVER_IP[] = "127.0.0.1"; +char DOMAINSERVER_IP[] = "54.241.92.53"; const int DOMAINSERVER_PORT = 40102; UDPSocket agentSocket(AGENT_UDP_PORT); @@ -73,7 +73,7 @@ int target_x, target_y; int target_display = 0; int head_mirror = 1; // Whether to mirror own head when viewing it -int sendToSelf = 0; +int sendToSelf = 1; int WIDTH = 1200; int HEIGHT = 800; @@ -129,9 +129,6 @@ GLfloat start_location[] = {6.1, 0, 1.4}; GLfloat location[] = {start_location[0], start_location[1], start_location[2]}; float fwd_vel = 0.0f; - -#define MAX_FILE_CHARS 100000 // Biggest file size that can be read to the system - int stats_on = 0; // Whether to show onscreen text overlay with stats int noise_on = 0; // Whether to add random noise @@ -941,6 +938,8 @@ int main(int argc, char** argv) // Create network socket and buffer incoming_packet = new char[MAX_PACKET_SIZE]; + + //gethostbyname(hostname); // Send one test packet to detect own IP, port: char selfTest[] = "T"; agentSocket.send((char *)"127.0.0.1", AGENT_UDP_PORT, selfTest, 1);