Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 442 was 441, checked in by scheusso, 17 years ago

some cmake hacking, some testing

File size: 753 bytes
Line 
1#include <iostream>
2#include "Server.h"
3#include "PacketManager.h"
4#include "PacketTypes.h"
5
6namespace network{
7 
8class dummyserver3 : 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}
31
32void dummyserver3::processChat( chat *data, int clientId){
33  std::cout << "Client " << clientId << " sent: " << data->message << std::endl;
34  sendMSG(data->message);
35}
36
37void dummyserver3::tick(){
38  Server::processQueue();
39}
40
41
42}
43
44int main(int argc, char **argv[]){
45  network::dummyserver3 server;
46  server.loop();
47  return 0; 
48}
Note: See TracBrowser for help on using the repository browser.