Changeset 190
- Timestamp:
- 03/23/09 10:52:00 (15 years ago)
- Location:
- vtcross/trunk/src
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/Makefile.am
r161 r190 1 1 include_HEADERS = error.h debug.h socketcomm.h cbr.h components.h \ 2 2 containers.h libvtcross.h common.h config.h 3 4 components_h_LDADD = ../lib/socketcomm/libsocketcomm.a -
vtcross/trunk/src/include/vtcross/components.h
r188 r190 23 23 24 24 #include "containers.h" 25 #include "socketcomm.h" 25 26 26 27 … … 33 34 public: 34 35 /* Asks the component at the passed socket FD for its component type 35 * string. 36 */ 37 virtual void GetRemoteComponentType() = 0; 36 * string. Note that this implementation is global for all component 37 * types, so is implemented here. Should a component need to override 38 * it, that is possible via dynamic binding or overloading. 39 */ 40 virtual std::string GetRemoteComponentType(int32_t componentSocketFD) 41 { 42 SendMessage(componentSocketFD, "request_component_type"); 43 44 char buffer[256]; 45 memset(buffer, 0, 256); 46 ReadMessage(componentSocketFD, buffer); 47 48 return std::string(buffer); 49 } 38 50 39 51 -
vtcross/trunk/src/lib/socketcomm/socketcomm.cpp
r189 r190 46 46 47 47 int32_t 48 ClientSocket(const char* serverName, const char* portNumber)48 ClientSocket(const char* serverName, const char* serverPort) 49 49 { 50 50 int32_t socketFD; … … 58 58 ERROR(1, "No server found by that hostname."); 59 59 60 portNumber = atoi( portNumber);60 portNumber = atoi(serverPort); 61 61 62 62 socketFD = socket(AF_INET, SOCK_STREAM, 0);