Net_Server
[ class tree: Net_Server ] [ index: Net_Server ] [ all elements ]

Class: Net_Server_Driver_Fork

Source Location: /Net_Server-1.0.3/Net/Server/Driver/Fork.php

Class Overview

PEAR
   |
   --Net_Server_Driver
      |
      --Net_Server_Driver_Fork

Forking server class.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: Net_Server_Driver

Net_Server_Driver::getEndCharacter()
Returns the readEndCharacter setting.
Net_Server_Driver::getLastSocketError()
return string for last socket error
Net_Server_Driver::setCallbackObject()
register a callback object
Net_Server_Driver::setDebugMode()
Set debug mode
Net_Server_Driver::setEndCharacter()
Sets the readEndCharacter setting.
Net_Server_Driver::_sendDebugMessage()
send a debug message

Class Details

[line 51]
Forking server class.

This class will fork a new process for each connection. This allows you to build servers, where communication between the clients is no issue.

Events that can be handled:

  • onStart
  • onConnect
  • onClose
  • onReceiveData



[ Top ]


Method Detail

broadcastData   [line 259]

void broadcastData( string $data, [array $exclude = array()])

send data to all clients
  • Access: public

Parameters:

string   $data   —  data to send
array   $exclude   —  client ids to exclude

[ Top ]

closeConnection   [line 283]

void closeConnection( )

close the current connection
  • Access: public

[ Top ]

getClientInfo   [line 270]

array getClientInfo( )

get current information about a client
  • Return: information about the client
  • Access: public

[ Top ]

getClients   [line 221]

PEAR_Error getClients( )

get current amount of clients

not possible with forking

  • Access: public

[ Top ]

isConnected   [line 206]

boolean isConnected( )

check, whether a client is still connected
  • Return: true if client is connected, false otherwise
  • Access: public

[ Top ]

sendData   [line 233]

void sendData( string $data, [boolean $debugData = true])

send data to a client
  • Access: public

Parameters:

string   $data   —  data to send
boolean   $debugData   —  flag to indicate whether data that is written to socket should also be sent as debug message

[ Top ]

serviceRequest   [line 163]

void serviceRequest( )

service the current request

[ Top ]

setMaxClients   [line 69]

void setMaxClients( int $maxClients)

set maximum amount of simultaneous connections

this is not possible as each client gets its own process

  • Access: public

Parameters:

int   $maxClients   — 

[ Top ]

shutDown   [line 306]

void shutDown( )

shutdown server
  • Access: public

[ Top ]

start   [line 79]

void start( )

start the server
  • Access: public

[ Top ]


Documentation generated on Wed, 09 Dec 2015 22:58:34 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.