Changeset 777 for code/branches/FICN/src/network/dummyclient3.cc
- Timestamp:
- Dec 31, 2007, 7:40:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/dummyclient3.cc
r632 r777 1 1 #include <iostream> 2 2 #include <string> 3 4 #include "util/Sleep.h" 3 5 #include "PacketManager.h" 4 6 #include "Client.h" 5 6 #ifdef WIN327 #include <windows.h>8 #define usleep(x) Sleep((x)/1000)9 #else10 #include <unistd.h>11 #endif12 7 13 8 using namespace network; … … 26 21 Client client( str, PORT ); 27 22 if ( client.establishConnection() ) 28 23 std::cout << "connection established" << std::endl; 29 24 else std::cout << "problems establishing connection" << std::endl; 30 25 char message[10000]; 31 26 char signs[] = "abcdefghijklmnopqrstuvwxy"; 32 27 while (true) { 33 34 35 36 37 38 39 40 41 42 43 28 client.tick(0); 29 30 std::cout << "your message2: "; 31 for ( int i=0; i<9999; i++ ) { 32 message[i] = signs[0]; 33 } 34 message[9999] = 'z'; 35 std::string str( message ); 36 client.sendChat( str ); 37 std::cout << str << std::endl; 38 std::cin.get(); std::cin.get(); 44 39 } 45 40 … … 49 44 50 45 void listener(){ 51 46 52 47 const int PORT = 55556; 53 48 std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl; … … 60 55 Client client( str, PORT ); 61 56 if ( client.establishConnection() ) 62 57 std::cout << "connection established" << std::endl; 63 58 else std::cout << "problems establishing connection" << std::endl; 64 59 65 60 while (true) { 66 67 61 client.tick(0); 62 usleep(100); 68 63 } 69 64
Note: See TracChangeset
for help on using the changeset viewer.