n2nc::Server Class Reference

#include <server.h>

Inheritance diagram for n2nc::Server:

Inheritance graph
[legend]
Collaboration diagram for n2nc::Server:

Collaboration graph
[legend]

List of all members.

Public Types

enum  server_command {
  CMD_REGISTER, CMD_REGISTER_ACK, CMD_PING, CMD_LEAVE,
  CMD_GET_CLIENT_INFO, CMD_GET_CLIENT_INFO_REPLY, CMD_CONNECT, CMD_CONNECT_ACK,
  CMD_CONNECT_OK, CMD_CONNECT_OK_ACK, CMD_SMSG, CMD_SMSG_ACK,
  CMD_DISCONNECT
}
enum  server_messages { MSG_OK = 0, MSG_ALREADY_REGISTERED, MSG_NOT_FOUND }

Public Member Functions

int listen (int port)
int shutdown (std::string message)
int check_clients_status ()
int show_clients ()
int sendCommand (enum server_command cmd, net::Socket &sock)

Classes

struct  packet


Detailed Description

Author:
fabsoft <fabsoft@gmail.com>

Definition at line 20 of file server.h.


Member Function Documentation

int n2nc::Server::listen ( int  port  ) 

int n2nc::Server::shutdown ( std::string  message  ) 

causes the server shutdown just after sending the given message to clients

Definition at line 75 of file server.cpp.

int n2nc::Server::check_clients_status (  ) 

checks if any client goes to timeout, if so that client will be removed from the list of online peers

Definition at line 265 of file server.cpp.

References n2nc::sync::Mutex::lock(), and n2nc::sync::Mutex::unlock().

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Mon Oct 6 19:32:35 2008 for n2nc by  doxygen 1.5.5