Changeset 5804 in orxonox.OLD for branches/network/src/subprojects
- Timestamp:
- Nov 28, 2005, 5:49:48 PM (19 years ago)
- Location:
- branches/network/src/subprojects/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/subprojects/network/network_unit_test.cc
r5800 r5804 36 36 SDL_Delay(20); 37 37 38 NetworkSocket client(ip , 9999);38 NetworkSocket client(ip); 39 39 40 40 char buf[1024]; … … 123 123 printf("=================\n"); 124 124 125 IPaddress ip; 126 //SDLNet_ResolveHost(&ip, "127.0.0.1", 9999); 127 SDLNet_ResolveHost(&ip, "localhost", 9999); 128 Synchronizeable* clientSync = new SimpleSync(); 129 Synchronizeable* serverSync = new SimpleSync(); 125 Synchronizeable* clientSync = new SimpleSync("Client\0"); 126 Synchronizeable* serverSync = new SimpleSync("Server\0"); 130 127 131 128 unsigned int port = 9999; 132 129 133 130 /* create the network manager */ … … 138 135 139 136 /* create a server stream */ 140 nm->createServer(*serverSync, 9999);137 nm->createServer(*serverSync, port); 141 138 142 139 /* esatblish a connection */ 140 IPaddress ip; 141 int error = SDLNet_ResolveHost(&ip, "127.0.0.1", port); 142 //SDLNet_ResolveHost(&ip, "localhost", port); 143 if(error == -1) printf("\n\nerror on address resolution, program inconsistancy\n\n"); 143 144 nm->establishConnection(ip, *clientSync); 144 145 -
branches/network/src/subprojects/network/simple_sync.cc
r5802 r5804 28 28 * default constructor 29 29 */ 30 SimpleSync::SimpleSync( )31 : Synchronizeable( )30 SimpleSync::SimpleSync(const char* name) 31 : Synchronizeable(name) 32 32 { 33 33 this->outLength = 10; -
branches/network/src/subprojects/network/simple_sync.h
r5800 r5804 13 13 { 14 14 public: 15 SimpleSync( );15 SimpleSync(const char* name); 16 16 ~SimpleSync(); 17 17 18 18 virtual void writeBytes(byte* data, int length); 19 19 virtual int readBytes(byte* data); 20 20 21 21 22 private:
Note: See TracChangeset
for help on using the changeset viewer.