ServerSocket

php\net\ServerSocket

Class SocketServer

Methods


__construct($port = null, $backLog = 50)
Parameters:
  • $portint
  • $backLogint
accept()

throws php\io\IOException

Returns:php\net\Socket
bind($hostname, $port, $backLog = 50)

throws php\net\SocketException

Parameters:
  • $hostnamestring
  • $portint
  • $backLogint
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:
  • $timeoutint
setReuseAddress($on)

Enable/disable the SO_REUSEADDR socket option.

throws php\net\SocketException

Parameters:
  • $onbool
setReceiveBufferSize($size)

throws php\net\SocketException

Parameters:
  • $sizeint
setPerformancePreferences($connectTime, $latency, $bandWidth)

Sets performance preferences for this ServerSocket.

! Not implemented yet for TCP/IP

Parameters:
  • $connectTimeint
  • $latencyint
  • $bandWidthint
static findAvailableLocalPort
Returns:int