Socket
May 1, 2018 ยท View on GitHub
- class
Socket(php\net\Socket) - package
std - source
php/net/Socket.php
Description
Class Socket
Methods
->__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
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.