Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/dummyserver3.cc @ 531

Last change on this file since 531 was 477, checked in by scheusso, 17 years ago

blub

File size: 776 bytes
Line 
1#include <iostream>
2#include "PacketManager.h"
3//#include "PacketTypes.h"
4#include "Server.h"
5
6namespace network{
7 
8class dummyserver3 : public Server{
9  public:
10  dummyserver3();
11  ~dummyserver3();
12  void loop();
13  private:
14  void tick();
15  void processChat( chat *data, int clientId);
16 
17 
18 
19};
20
21dummyserver3::dummyserver3(){
22}
23dummyserver3::~dummyserver3(){
24}
25
26void dummyserver3::loop(){
27  open();
28  while(true){
29    tick();
30    usleep(100);
31  }
32}
33
34void dummyserver3::processChat( chat *data, int clientId){
35  std::cout << "Client " << clientId << " sent: " << data->message << std::endl;
36  sendMSG(data->message);
37}
38
39void dummyserver3::tick(){
40  processQueue();
41}
42
43
44}
45
46int main(int argc, char **argv[]){
47  network::dummyserver3 server;
48  server.loop();
49  return 0; 
50}
Note: See TracBrowser for help on using the repository browser.