_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes
netdriver.h File Reference
#include <time.h>
#include "net_lowlevel.h"

Go to the source code of this file.

Classes

class  ServerStruct
 
class  Session
 
class  SessionPool
 

netdriver.h - Net driver header.

#define DEFAULT_PORT   7775
 
#define DEFAULT_MAX_CONN   500
 
#define DEFAULT_SESSION_TIMEOUT   900
 
#define DEFAULT_POLLING_DELAY   250
 
#define MAX_USERNAME_LENGTH   32
 
#define MAX_PASSWORD_LENGTH   32
 
#define MAX_GAMENAME_LENGTH   32
 
#define MAX_VERSION_LENGTH   8
 
ServerStruct Server
 
SessionPoolPool
 external reference to session tracking. More...
 
void Send (Session *session, const char *msg)
 
int ServerInit (int port)
 
void ServerQuit (void)
 
int UpdateSessions (void)
 

Macro Definition Documentation

#define DEFAULT_MAX_CONN   500
#define DEFAULT_POLLING_DELAY   250
#define DEFAULT_PORT   7775
#define DEFAULT_SESSION_TIMEOUT   900
#define MAX_GAMENAME_LENGTH   32
#define MAX_PASSWORD_LENGTH   32
#define MAX_USERNAME_LENGTH   32
#define MAX_VERSION_LENGTH   8

Function Documentation

void Send ( Session session,
const char *  msg 
)

Send a message to a session

Parameters
sessionSession to send the message to
msgMessage to send
int ServerInit ( int  port)

Initialize the server

Parameters
portDefines the port to which the server will bind.
Returns
0 for success, non-zero for failure
void ServerQuit ( void  )

ServerQuit: Releases the server socket.

int UpdateSessions ( void  )

Accepts new connections, receives data, manages buffers,

Variable Documentation

SessionPool* Pool

external reference to session tracking.

ServerStruct Server
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.