Class Server

(line 21)
Base
   |
   --Server

Located in File: Program_Root/sdk/server/Server.php


$Id: Server.php,v 1.1.1.1 2003/03/27 10:27:42 maro Exp $

Provides a simple socket server for receiving SMS and Notification requests from the gateway.


Class Variable Summary
$__listener
Listener object for callbacks
Default Value: -><-
$__socket
The listening socket
Default Value: -><-

Inherited Class Variable Summary
Inherited From Class Base
Variable Default Value Description
Base::$clazz -> <-
Base::$logFile -> _DEBUG_FILE <-
Base::$loglevel -> _DEBUG_LEVEL <- debug - logstatements above and including 'debug' are printed.
Base::$loglevels ->array ("debug" => 0, "info" => 1, "warn" => 2, "fatal" => 3) <-
Base::$logoutput -> _DEBUG_OUTPUT <- 0 - log to screen
Base::$method -> <-

Method Summary
void constructor Server ( )
Creates a new Server
void addEventListener ( $listener )
Adds the listener which is called when requests are received.
void onMessageReceive ( $message )
This function is called when the ServerSocket receives an incoming message. The message is parsed and depending on request-type different call-back methods are called, either 'onSMSReceive' or 'onNotificationReceive'.
void run ( )
Starts the server, which connects to the gateway and listens for requests.
void sendResponse ( $response )
Sends a Response object back to the gateway.
Inherited Method Summary
Inherited From Class Base
Function Description
Base::Base()
Base::dbg()
Base::formatLongDate()
Base::formatLongDateTime()
Base::formatShortDate()
Base::formatShortDateTime()
Base::logDebug()
Base::logFatal()
Base::logInfo()
Base::logWarn()
Base::registerClass()
Base::registerMethod()
Base::setLoglevel()
Base::toFile()
Base::toScreen()

Method Detail

Constructor Server

(line 34)

void Server( string $host, int $port)

Creates a new Server
Function Parameters:
- string $host:
- int $port:
Function Info:

[ Top ]


addEventListener

(line 56)

void addEventListener( object $listener)

Adds the listener which is called when requests are received.

This is only used by the GatewayListener.

Function Parameters:
- object $listener: the object listening for requests.
Function Info:
see - sdk.GatewaySender

[ Top ]


onMessageReceive

(line 68)

void onMessageReceive( string $message)

This function is called when the ServerSocket receives an incoming message. The message is parsed and depending on request-type different call-back methods are called, either 'onSMSReceive' or 'onNotificationReceive'.
Function Parameters:
- string $message: incoming from socket.
Function Info:

[ Top ]


run

(line 43)

void run( )

Starts the server, which connects to the gateway and listens for requests.
Function Info:

[ Top ]


sendResponse

(line 90)

void sendResponse( Response $response)

Sends a Response object back to the gateway.
Function Parameters:
- Response $response: the response object
Function Info:

[ Top ]



Variable Detail

$__listener

(line 25)
Data type: mixed
Listener object for callbacks

[ Top ]

$__socket

(line 27)
Data type: mixed
The listening socket

[ Top ]



Documention generated on Mon, 31 Mar 2003 10:17:46 +0200 by phpDocumentor 1.2.0rc1