ServerSocket¶
-
php\net\ServerSocket
Class SocketServer
Methods
__construct
($port = null, $backLog = 50)¶
Parameters:
- $port – int
- $backLog – int
accept
()¶throws php\io\IOException
Returns: php\net\Socket
bind
($hostname, $port, $backLog = 50)¶throws php\net\SocketException
Parameters:
- $hostname – string
- $port – int
- $backLog – int
close
()¶throws php\io\IOException
isClosed
()¶
Returns: bool
isBound
()¶Returns the binding state of the ServerSocket.
Returns: bool
setSoTimeout
($timeout)¶Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
throws php\net\SocketException
Parameters:
- $timeout – int
setReuseAddress
($on)¶Enable/disable the SO_REUSEADDR socket option.
throws php\net\SocketException
Parameters:
- $on – bool
setReceiveBufferSize
($size)¶throws php\net\SocketException
Parameters:
- $size – int
setPerformancePreferences
($connectTime, $latency, $bandWidth)¶Sets performance preferences for this ServerSocket.
! Not implemented yet for TCP/IP
Parameters:
- $connectTime – int
- $latency – int
- $bandWidth – int
- static
findAvailableLocalPort
¶
Returns: int