Changeset 208 for code/branches/network/src/network/dummyclient.cc
- Timestamp:
- Nov 14, 2007, 3:35:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/dummyclient.cc
r204 r208 5 5 6 6 #include <iostream> 7 #include <string> 7 8 #include <enet/enet.h> 8 9 #include "network/PacketManager.h" … … 20 21 atexit(enet_deinitialize); 21 22 22 enet_address_set_host(&address, "127.0.0.1"); 23 cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl; 24 string str; 25 getline(cin, str); 26 cout << "You entered: " << str << endl; 27 if(str.compare("")==0) 28 str="127.0.0.1"; 29 30 enet_address_set_host(&address, str.c_str()); 23 31 address.port = 5555; 24 32 … … 38 46 // wait 5 seconds for the connection attempt to succeed 39 47 if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){ 40 puts("Connection to localhost:5555 succeeded."); 48 cout << "Connection to " << str << " succeeded." << endl; 49 //puts("Connection to localhost:5555 succeeded."); 41 50 }else{ 42 51 enet_peer_reset(peer); 43 puts("Connection to localhost:5555 failed."); 52 cout << "Connection to " << str << " failed." << endl; 53 //puts("Connection to localhost:5555 failed."); 44 54 } 45 55
Note: See TracChangeset
for help on using the changeset viewer.