Changeset 498 for vtcross/trunk/src/libvtcross
- Timestamp:
- 10/03/09 18:48:33 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/libvtcross/libvtcross.cpp
r412 r498 22 22 23 23 #include <cstdlib> 24 #include <string> 24 25 25 26 #include "vtcross/common.h" … … 27 28 #include "vtcross/libvtcross.h" 28 29 29 30 uint32_t 31 ConnectToRemoteComponent() 32 { 33 // TODO why is this hardcoded like this?? 34 return ClientSocket("localhost", "40000"); 35 } 30 using namespace std; 31 32 33 /* Strings that store the remote (or local) shell location for use within the 34 * ConnectToShell() function. Note that these values must be set with the 35 * SetCrossShellLocation public function within the client code. */ 36 string shellHostname; 37 string shellPort; 38 39 40 uint32_t 41 ConnectToShell() 42 { 43 return ClientSocket(shellHostname.c_str(), shellPort.c_str()); 44 } 45 46 47 void 48 SetCrossShellLocation(string hostname, string port) 49 { 50 shellHostname = hostname; 51 shellPort = port; 52 } 53 36 54 37 55 // TODO the following three functions all do exactly the same thing. Why not … … 42 60 char buffer[256]; 43 61 44 uint32_t socketfd = ConnectTo RemoteComponent();62 uint32_t socketfd = ConnectToShell(); 45 63 SendMessage(socketfd, "get_number_observables"); 46 64 … … 57 75 char buffer[256]; 58 76 59 uint32_t socketfd = ConnectTo RemoteComponent();77 uint32_t socketfd = ConnectToShell(); 60 78 SendMessage(socketfd, "get_number_utilities"); 61 79 … … 72 90 char buffer[256]; 73 91 74 uint32_t socketfd = ConnectTo RemoteComponent();92 uint32_t socketfd = ConnectToShell(); 75 93 SendMessage(socketfd, "set_active_mission"); 76 94 … … 88 106 char buffer[256]; 89 107 90 uint32_t socketfd = ConnectTo RemoteComponent();108 uint32_t socketfd = ConnectToShell(); 91 109 SendMessage(socketfd, "get_number_parameters"); 92 110 … … 117 135 char buffer[256]; 118 136 119 uint32_t socketFD = ConnectTo RemoteComponent();137 uint32_t socketFD = ConnectToShell(); 120 138 SendMessage(socketFD, "request_optimization"); 121 139 … … 170 188 char var[50]; 171 189 172 uint32_t socketFD = ConnectTo RemoteComponent();190 uint32_t socketFD = ConnectToShell(); 173 191 SendMessage(socketFD, "update_performance"); 174 192