- class
Socket
(php\net\Socket
) - package
std
- source
php/net/Socket.php
Description
Class Socket
->
__construct()
->
getOutput()
->
getInput()
->
getLocalAddress()
->
getAddress()
->
getLocalPort()
->
getPort()
->
close()
->
shutdownInput()
->
shutdownOutput()
->
isConnected()
->
isClosed()
->
isBound()
->
isInputShutdown()
->
isOutputShutdown()
->
connect()
- Connects this socket to the server->
bind()
- Binds the socket to a local address.->
bindDefault()
- the system will pick up->
setSoTimeout()
- Enable/disable SO_TIMEOUT with the specified timeout, in->
setSoLinger()
->
setReuseAddress()
- Enable/disable the SO_REUSEADDR socket option.->
setReceiveBufferSize()
->
setTcpNoDelay()
->
setKeepAlive()
->
setOOBInline()
->
setSendBufferSize()
->
setTrafficClass()
- Sets traffic class or type-of-service octet in the IP->
setPerformancePreferences()
- Sets performance preferences for this ServerSocket.->
sendUrgentData()
- Send one byte of urgent data on the socket. The byte to be sent is the lowest eight
__construct(null|string $host, null|int $port): void
getOutput(): MiscStream
getInput(): MiscStream
getLocalAddress(): string
getAddress(): string
getLocalPort(): int
getPort(): int
close(): void
shutdownInput(): void
shutdownOutput(): void
isConnected(): bool
isClosed(): bool
isBound(): bool
isInputShutdown(): bool
isOutputShutdown(): bool
connect(string $hostname, int $port, null|int $timeout): void
Connects this socket to the server
bind(string $hostname, int $port): void
Binds the socket to a local address.
bindDefault(): void
the system will pick up an ephemeral port and a valid local address to bind the socket.
setSoTimeout(int $timeout): void
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoLinger(bool $on, int $linger): void
setReuseAddress(bool $on): void
Enable/disable the SO_REUSEADDR socket option.
setReceiveBufferSize(int $size): void
setTcpNoDelay(bool $on): void
setKeepAlive(bool $on): void
setOOBInline(bool $on): void
setSendBufferSize(int $size): void
setTrafficClass(int $tc): void
Sets traffic class or type-of-service octet in the IP header for packets sent from this Socket.
setPerformancePreferences(int $connectTime, int $latency, int $bandWidth): void
Sets performance preferences for this ServerSocket.
! Not implemented yet for TCP/IP
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.