[ 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


Forking server class.



Inherited Variables

Inherited Methods

Class: Net_Server_Driver

Returns the readEndCharacter setting.
return string for last socket error
register a callback object
Set debug mode
Sets the readEndCharacter setting.
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


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


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


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 Mon, 11 Mar 2019 15:47:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.