- Timestamp:
- Nov 23, 2005, 2:59:11 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_socket.cc
r5729 r5732 58 58 PRINTF(0)("NetworkSocket created\n"); 59 59 60 } 61 62 /** 63 * Constructor to connect directly 64 */ 65 NetworkSocket::NetworkSocket(char * ipAddress, unsigned int port) 66 { 67 NetworkSocket(); 68 IPaddress ip; 69 SDLNet_ResolveHost(&ip, ipAddress, port); 70 connectToServer(ip, port); 60 71 } 61 72 -
branches/network/src/lib/network/network_socket.h
r5729 r5732 24 24 #ifdef HAVE_SDL_H 25 25 #include <SDL_Thread.h> 26 #else 26 #else 27 27 #include <SDL/SDL_thread.h> 28 28 #endif … … 73 73 74 74 NetworkSocket(); 75 NetworkSocket(char * ipAddress, unsigned int port); 75 76 ~NetworkSocket(); 76 77 -
branches/network/src/subprojects/network/network_unit_test.cc
r5650 r5732 30 30 int testSocket(int argc, char** argv) 31 31 { 32 NetworkSocket client;33 32 NetworkSocket server; 34 IPaddress ip;35 SDLNet_ResolveHost(&ip, "127.0.0.1", 9999);36 33 server.listen(9999); 37 34 SDL_Delay(20); 38 client.connectToServer(ip, 9999); 35 36 NetworkSocket client("127.0.0.1", 9999); 37 39 38 char buf[1024]; 40 39 … … 121 120 printf("TestFramework\n"); 122 121 printf("=================\n"); 123 122 124 123 IPaddress ip; 125 124 //SDLNet_ResolveHost(&ip, "127.0.0.1", 9999); … … 127 126 Synchronizeable* clientSync = new SimpleSync(); 128 127 Synchronizeable* serverSync = new SimpleSync(); 129 130 131 128 129 130 132 131 /* create the network manager */ 133 132 NetworkManager* nm = new NetworkManager(); … … 138 137 /* create a server stream */ 139 138 nm->createServer(*serverSync, 9999); 140 139 141 140 /* esatblish a connection */ 142 141 nm->establishConnection(ip, *clientSync); … … 146 145 nm->synchronize(); 147 146 } 148 147 149 148 /* delete the network manager again */ 150 149 delete nm; 151 150 152 151 return 0; 153 152 } … … 172 171 173 172 startHelp(argc, argv); 174 173 175 174 return 0; 176 175 }
Note: See TracChangeset
for help on using the changeset viewer.