PHP 클래스 Wrench\Socket\Socket
Implements low level logic for connecting, serving, reading to, and
writing from WebSocket connections using PHP's streams.
Unlike in previous versions of this library, a Socket instance now
represents a single underlying socket resource. It's designed to be used
by aggregation, rather than inheritance.
파일 보기
프로젝트 열기: varspool/Wrench
1 사용 예제들
보호된 프로퍼티들
프로퍼티 |
타입 |
설명 |
|
$connected |
boolean |
Note, the connection may not be ready to use, but the socket is
connected at least. See $handshaked, and other properties in
subclasses. |
|
$context |
|
Stream context |
|
$firstRead |
boolean |
Whether the current read is the first one to the socket |
|
$name |
string |
The socket name according to stream_socket_get_name |
|
$socket |
resource |
|
|
공개 메소드들
보호된 메소드들
메소드 상세
Gets the IP address of the socket
Get the last error that occurred on the socket
Gets the name of the socket
PHP seems to return IPV6 address/port combos like this:
::1:1234, where ::1 is the address and 1234 the port
So, the part number here is either the last : delimited section (the port)
or all the other sections (the whole initial part, the address).
Gets the port of the socket
Whether the socket is currently connected
Receive data from the socket
프로퍼티 상세
Note, the connection may not be ready to use, but the socket is
connected at least. See $handshaked, and other properties in
subclasses.
protected bool $connected |
리턴 |
boolean |
|
Whether the current read is the first one to the socket
protected bool $firstRead |
리턴 |
boolean |
|
The socket name according to stream_socket_get_name
protected string $name |
리턴 |
string |
|
protected resource $socket |
리턴 |
resource |
|