Skip to content

Latest commit

 

History

History
319 lines (225 loc) · 5.36 KB

Socket.md

File metadata and controls

319 lines (225 loc) · 5.36 KB

Socket

  • class Socket (php\net\Socket)
  • package std
  • source php/net/Socket.php

Description

Class Socket


Methods


Methods

__construct()

__construct(null|string $host, null|int $port): void

getOutput()

getOutput(): MiscStream

getInput()

getInput(): MiscStream

getLocalAddress()

getLocalAddress(): string

getAddress()

getAddress(): string

getLocalPort()

getLocalPort(): int

getPort()

getPort(): int

close()

close(): void

shutdownInput()

shutdownInput(): void

shutdownOutput()

shutdownOutput(): void

isConnected()

isConnected(): bool

isClosed()

isClosed(): bool

isBound()

isBound(): bool

isInputShutdown()

isInputShutdown(): bool

isOutputShutdown()

isOutputShutdown(): bool

connect()

connect(string $hostname, int $port, null|int $timeout): void

Connects this socket to the server


bind()

bind(string $hostname, int $port): void

Binds the socket to a local address.


bindDefault()

bindDefault(): void

the system will pick up an ephemeral port and a valid local address to bind the socket.


setSoTimeout()

setSoTimeout(int $timeout): void

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.


setSoLinger()

setSoLinger(bool $on, int $linger): void

setReuseAddress()

setReuseAddress(bool $on): void

Enable/disable the SO_REUSEADDR socket option.


setReceiveBufferSize()

setReceiveBufferSize(int $size): void

setTcpNoDelay()

setTcpNoDelay(bool $on): void

setKeepAlive()

setKeepAlive(bool $on): void

setOOBInline()

setOOBInline(bool $on): void

setSendBufferSize()

setSendBufferSize(int $size): void

setTrafficClass()

setTrafficClass(int $tc): void

Sets traffic class or type-of-service octet in the IP header for packets sent from this Socket.


setPerformancePreferences()

setPerformancePreferences(int $connectTime, int $latency, int $bandWidth): void

Sets performance preferences for this ServerSocket.

! Not implemented yet for TCP/IP


sendUrgentData()

sendUrgentData(int $data): void

Send one byte of urgent data on the socket. The byte to be sent is the lowest eight bits of the data parameter.