SockIt
Public Member Functions

Server Class Reference

#include <Server.h>

Inheritance diagram for Server:
NetworkObject TcpServer UdpServer

List of all members.

Public Member Functions

 Server ()
virtual ~Server ()
virtual void start_listening ()=0
virtual int get_port ()=0
 FB_JSAPI_EVENT (open, 0,())

Detailed Description

An abstract interface for a server object. This registers the generic server-specific events to javascript, and registers the 'start_listening' method to the javascript API.

Definition at line 17 of file Server.h.


Constructor & Destructor Documentation

Server::Server ( )

Default constructor for a server object, which registers the 'start_listening' function to the javascript API.

Definition at line 10 of file Server.cpp.

References get_port(), and start_listening().

{
    registerMethod("listen", make_method(this, &Server::start_listening));
    registerMethod("getPort", make_method(this, &Server::get_port));
}
virtual Server::~Server ( ) [inline, virtual]

Deconstructs a server object

Definition at line 29 of file Server.h.

{}

Member Function Documentation

Server::FB_JSAPI_EVENT ( open  ,
,
()   
)

A javascript event to be fired when the server has started listening for incoming connections successfully.

virtual int Server::get_port ( ) [pure virtual]

Returns the port on which this server listens

Implemented in TcpServer, and UdpServer.

Referenced by Server().

virtual void Server::start_listening ( ) [pure virtual]

Called to start the the server listening for the first time, fires the 'open' event, and is exposed to the javascript. This should only be called once, and starts the server listening for incoming connections.

Implemented in TcpServer, and UdpServer.

Referenced by Server().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Friends Defines