Asyncore
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Asyncore\Server Class Reference

Public Member Functions

 __construct (array $streams=[])
 
 __destruct ()
 
 onClient (callable $client_handler)
 

Static Public Member Functions

static createStream (string $address, $public_key_file=null, $private_key_file=null)
 

Public Attributes

 $streams
 
 $handshaking_clients = []
 
 $client_handler
 

Detailed Description

Since
2.2

Constructor & Destructor Documentation

◆ __construct()

Asyncore\Server::__construct ( array  $streams = [])
Parameters
array<resource>$streams The streams the server listens for new connections on.
See also
Server::createStream()

◆ __destruct()

Asyncore\Server::__destruct ( )

Member Function Documentation

◆ createStream()

static Asyncore\Server::createStream ( string  $address,
  $public_key_file = null,
  $private_key_file = null 
)
static

Creates a stream for a server to listen for new connections on.

Parameters
string$addresse.g. "0.0.0.0:80"
string | null$public_key_filePath to the file containing your PEM-encoded public key or null if you don't want encryption
string | null$private_key_filePath to the file containing your PEM-encoded private key or null if you don't want encryption
Returns
resource
Exceptions
Exception
See also
https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail

◆ onClient()

Asyncore\Server::onClient ( callable  $client_handler)

Sets the function to be called when a client has connected and finished the TLS handshake, if applicable.

Parameters
callable$client_handler

Member Data Documentation

◆ $client_handler

callable Asyncore\Server::$client_handler

◆ $handshaking_clients

array Asyncore\Server::$handshaking_clients = []

Contains clients that are still pending the TLS handshake.

◆ $streams

array< resource > Asyncore\Server::$streams

The streams the server listens for new connections on.