Class ServerSocket

(line 18)
Base
   |
   --ServerSocket

Located in File: Program_Root/sdk/socket/ServerSocket.php


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

Provides a simple Socket object for use when listening on sockets.


Class Variable Summary
$__host
Host to connect to
Default Value: -> ""<-
$__listener
Listener object for callbacks
Default Value: -><-
$__port
Port to connect to
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 ServerSocket ( $host, $port )
Creates a new ServerSocket for use with specified host and port
void addMessageListener ( $listener )
Adds the listener which is called when requests are received.
void listen ( )
Listens on specified host and port for incoming requests from gateway.
void send ( $msg )
Sends a message back to the gateway using the connected socket.
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 ServerSocket

(line 35)

void ServerSocket( string $host, int $port)

Creates a new ServerSocket for use with specified host and port
Function Parameters:
- string $host:
- int $port:
Function Info:

[ Top ]


addMessageListener

(line 48)

void addMessageListener( object $listener)

Adds the listener which is called when requests are received.

This is only used in GatewayListener.

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

[ Top ]


listen

(line 60)

void listen( )

Listens on specified host and port for incoming requests from gateway.

Calls callback-method 'onMessageReceive' on the listener object when message from socket is read.

Function Info:
see - ServerSocket::$__listener

[ Top ]


send

(line 86)

void send( string $msg)

Sends a message back to the gateway using the connected socket.
Function Parameters:
- string $msg: message to send.
Function Info:

[ Top ]



Variable Detail

$__host

(line 22)
Data type: mixed
Host to connect to

[ Top ]

$__listener

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

[ Top ]

$__port

(line 24)
Data type: mixed
Port to connect to

[ Top ]

$__socket

(line 28)
Data type: mixed
The listening socket

[ Top ]



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