Last change
on this file since 442 was
441,
checked in by scheusso, 17 years ago
|
some cmake hacking, some testing
|
File size:
763 bytes
|
Line | |
---|
1 | #include <iostream> |
---|
2 | #include <string> |
---|
3 | #include "PacketManager.h" |
---|
4 | #include "Client.h" |
---|
5 | |
---|
6 | using namespace network; |
---|
7 | |
---|
8 | int main(){ |
---|
9 | network::PacketGenerator pck; |
---|
10 | const int PORT = 55556; |
---|
11 | std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl; |
---|
12 | std::string str; |
---|
13 | std::getline(std::cin, str); |
---|
14 | std::cout << "You entered: " << str << std::endl; |
---|
15 | if(str.compare("")==0) |
---|
16 | str="127.0.0.1"; |
---|
17 | |
---|
18 | Client client( str, PORT ); |
---|
19 | if ( client.establishConnection() ) |
---|
20 | std::cout << "connection established" << std::endl; |
---|
21 | else std::cout << "problems establishing connection" << std::endl; |
---|
22 | |
---|
23 | while (true) { |
---|
24 | client.update(); |
---|
25 | std::cout << "your message: "; |
---|
26 | std::getline( std::cin, str ); |
---|
27 | client.sendChat( str ); |
---|
28 | } |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.