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

Class: System_Socket_ConnectionPool

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

Class Overview


System_Socket_ConnectionPool


Author(s):

Version:

  • $Revision: 1.1 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 34]
System_Socket_ConnectionPool
  • Author: Michael Wallner <mike@php.net>
  • Version: $Revision: 1.1 $
  • Access: public


[ Top ]


Class Variables

$pool = array()

[line 42]

Socket pool
  • Access: protected

Type:   array


[ Top ]



Method Detail

System_Socket_ConnectionPool (Constructor)   [line 55]

object System_Socket_ConnectionPool System_Socket_ConnectionPool( &$sockets, array $sockets)

Constructor

Instantiate a new System_Socket_ConnectionPool object and add specified array of socket connections to the pool. Actually the method System_Socket_ConnectionPool::push() gets called for each array element.

  • Access: public

Parameters:

array   $sockets   —  reference to an array of socket connections
   &$sockets   — 

[ Top ]

call   [line 202]

array call( string $method, mixed 1)

Call a method by name of all connections
  • Access: public

Parameters:

string   $method   — 
mixed   1   —  [$arg[, $arg[, ...]]]

[ Top ]

close   [line 143]

void close( )

Close all connections of this pool

Each socket resource handle will be closed and all System_Socket_Connection objects of this pool will be unset.

  • Access: public

[ Top ]

count   [line 157]

int count( )

Count connections
  • Access: public

[ Top ]

getConnections   [line 128]

array &getConnections( )

Get all connections

This method returns a refernce to the connection pool array.

  • Return: connection pool
  • Access: public

[ Top ]

push   [line 85]

bool push( &$s, mixed $s)

Push a socket connection

Add a System_Socket_Connection object to the pool. You can push one of the following values: * a valid socket resource handle * a System_Socket_Connection object * a System_Socket object

  • Access: public

Parameters:

mixed   $s   —  resource handle or System_Socket[_Connection] object
   &$s   — 

[ Top ]

read   [line 185]

array read( [int $bytes = 4096])

Read from all connections
  • Access: public

Parameters:

int   $bytes   — 

[ Top ]

shift   [line 115]

object System_Socket_Connection &shift( )

Shift a socket connection

Retrieve a System_Socket_Connection object from the pool. Note that the System_Socket_ConnecionPool object will no longer contain the shifted connection.

  • Access: public

[ Top ]

write   [line 169]

array write( string $data)

Write to all connections
  • Access: public

Parameters:

string   $data   — 

[ Top ]


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