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

Class: System_Socket_Listener

Source Location: /System_Socket-0.4.0/Socket/Listener.php

Class Overview

PEAR
   |
   --System_Socket_Manager
      |
      --System_Socket_Listener

System_Socket_Listener


Author(s):

Version:

  • $Revision: 1.24 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 63]
System_Socket_Listener

Example:

  1.    require_once 'System/Socket.php';
  2.    $Listener &System_Socket::createListener(array(
  3.        'address'   => '/tmp/pear.sock',
  4.        'domain'    => AF_UNIX,
  5.        'proto'     => SOL_SOCKET,
  6.    ));
  7.    while ($Listener->hasSocket{
  8.        $Pool &$Listener->getReadableClients();
  9.        while ($Connection &$Pool->shift()) {
  10.            if (trim($line $Connection->readLine()) == 'exit'{
  11.                $Connection->close();
  12.                $Pool->close();
  13.                $Listener->close();
  14.            }
  15.            echo $line;
  16.        }
  17.        usleep(10);
  18.    }

  • Author: Michael Wallner <mike@php.net>
  • Version: $Revision: 1.24 $
  • Access: public


[ Top ]


Class Variables

$allowDeny =  null

[line 81]

hostsAllow/hostsDeny

'allow' | 'deny' | empty

  • Access: public

Type:   string


[ Top ]

$Clients = array()

[line 71]

Clients
  • Access: public

Type:   mixed


[ Top ]



Method Detail

System_Socket_Listener (Constructor)   [line 106]

object System_Socket_Listener System_Socket_Listener( &$socket, object SystemSocket $socket)

Constructor
  • Access: public

Parameters:

object SystemSocket   $socket   — 
   &$socket   — 

[ Top ]

getClients   [line 306]

object System_Socket_ConnectionPool &getClients( )

Get all Clients
  • Access: public

[ Top ]

getExceptionalClients   [line 294]

object &getExceptionalClients( )

Get exceptional clients
  • Access: public

[ Top ]

getReadableClients   [line 269]

object &getReadableClients( )

Get readable clients
  • Access: public

[ Top ]

getWritableClients   [line 282]

object &getWritableClients( )

Get writable clients
  • Access: public

[ Top ]

hasAccessRights   [line 385]

bool hasAccessRights( int $socket)

hasAccessRights

Check whether a certain socket resource has access rights.

  • Access: public

Parameters:

int   $socket   —  socket resource

[ Top ]

hostsAllow   [line 319]

mixed hostsAllow( string $mask)

hostsAllow
  • Access: public

Parameters:

string   $mask   —  network (address) to allow

[ Top ]

hostsAllowDeny   [line 355]

mixed hostsAllowDeny( $mask, $allow)

hostsAllowDeny
  • Access: protected

Parameters:

   $mask   — 
   $allow   — 

[ Top ]

hostsDeny   [line 331]

mixed hostsDeny( string $mask)

hostsDeny
  • Access: public

Parameters:

string   $mask   —  network (address) to deny

[ Top ]

hostsReset   [line 343]

void hostsReset( [string $allowDeny = null])

hostsReset
  • Access: public

Parameters:

string   $allowDeny   —  will become System_Socket_Listener::allowDeny

[ Top ]

setPoolClass   [line 178]

bool setPoolClass( [string $poolClass = 'System_Socket_ConnectionPool'])

Set ConnectionPool class

Set the classname of a (custom) ConnectionPool.

  • Access: public

Parameters:

string   $poolClass   —  the name of an existing class

[ Top ]


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