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

Class: Net_Server_Multiprocess

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

Class Overview

PEAR
   |
   --Net_Server_Driver
      |
      --Net_Server_Multiprocess

Base class for all drivers


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 22]
Base class for all drivers

This class provides methods, can be used by all server implementations.



[ Top ]


Method Detail

broadcastData   [line 216]

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 242]

void closeConnection( [int $i = 0])

close connection to a client
  • Access: public

Parameters:

int   $i   —  internal ID of the client

[ Top ]

getClientInfo   [line 228]

array getClientInfo( int $i)

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

Parameters:

int   $i   —  ID of the client

[ Top ]

getClients   [line 179]

int getClients( )

get current amount of clients
  • Return: amount of clients
  • Access: public

[ Top ]

isConnected   [line 166]

boolean isConnected( $i, integer $id)

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

Parameters:

integer   $id   —  client id
   $i   — 

[ Top ]

raiseError   [line 299]

void raiseError( $msg)


Parameters:

   $msg   — 

[ Top ]

sendData   [line 193]

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

send data to a client
  • Access: public

Parameters:

int   $clientId   —  ID of the client
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 ]

setConsole   [line 88]

void setConsole( string $classname)

set the console class for this server
  • Access: public

Parameters:

string   $classname   — 

[ Top ]

setMaxClients   [line 41]

void setMaxClients( int $maxClients)

set maximum amount of simultaneous connections that's to say the maximum number of listener processes that this server can handle
  • Access: public

Parameters:

int   $maxClients   — 

[ Top ]

setMaxIdle   [line 65]

void setMaxIdle( int $secs)

set the maximun time a process can be sleeping (without serving any request) before MPM kill it NOT USED AT THIS MOMENT
  • Access: public

Parameters:

int   $secs   — 

[ Top ]

setMPM   [line 77]

void setMPM( string $mpm)

set the MPM layout for this server (only preforkg avaible for now)
  • Access: public

Parameters:

string   $mpm   — 

[ Top ]

setStartPool   [line 52]

void setStartPool( int $dim)

set the initial number of listener processes
  • Access: public

Parameters:

int   $dim   — 

[ Top ]

shutDown   [line 278]

void shutDown( )

Shutdown server

---------------------------- ATTENTION ------------------------------------- On multiprocess layouts stopping the server ==> stopping all processes that are listening on server port; we generally can't do this operation from the same server instance, because it only knows of the existence of processes that it forked at start(). This start pool is equivalent to running pool in every moment only if we're running the MPM-static. With more complex MPM like the pre-forking one the process responsible for forking new listeners at run-time is MPM, so we must make a call to it in order to stop all forked processes. Of course if we have a running MPM and a running console, stopping the server requires stopping them too.

  • Access: public

[ Top ]

start   [line 98]

void start( )

start the server
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.