You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple and lightweight OOP wrapper for PHP's lowlevel sockets extension (ext-sockets)
3
+
Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets)
4
4
5
-
PHP offers two networking APIs, the newer [streams API](http://php.net/manual/en/book.stream.php) and the older [socket API](http://www.php.net/manual/en/ref.sockets.php).
5
+
PHP offers two networking APIs, the newer [streams API](https://www.php.net/manual/en/book.stream.php) and the older [socket API](https://www.php.net/manual/en/ref.sockets.php).
6
6
While the former has been a huge step forward in generalizing various streaming resources,
7
-
it lacks some of the advanced features of the original and much more lowlevel socket API.
7
+
it lacks some of the advanced features of the original and much more low-level socket API.
8
8
This lightweight library exposes this socket API in a modern way by providing a thin wrapper around the underlying API.
9
9
10
10
***Full socket API** -
11
-
It exposes the whole [socket API](http://www.php.net/manual/en/ref.sockets.php) through a *sane* object-oriented interface.
11
+
It exposes the whole [socket API](https://www.php.net/manual/en/ref.sockets.php) through a *sane* object-oriented interface.
12
12
Provides convenience methods for common operations as well as exposing all underlying methods and options.
13
13
***Fluent interface** -
14
14
Uses a fluent interface so you can easily chain method calls.
@@ -18,7 +18,7 @@ This lightweight library exposes this socket API in a modern way by providing a
18
18
and does not get in your way.
19
19
This library is merely a very thin wrapper and has no other external dependencies.
20
20
***Good test coverage** -
21
-
Comes with an automated test suite and is regularly tested in the *real world*
21
+
Comes with an automated test suite and is regularly tested in the *real world*.
22
22
23
23
**Table of contents**
24
24
@@ -64,7 +64,7 @@ See also the [examples](examples).
64
64
### Factory
65
65
66
66
As shown in the [quickstart example](#quickstart-example), this library uses a `Factory` pattern
67
-
as a simple API to [`socket_create()`](http://www.php.net/manual/en/function.socket-create.php).
67
+
as a simple API to [`socket_create()`](https://www.php.net/manual/en/function.socket-create.php).
68
68
It provides simple access to creating TCP, UDP, UNIX, UDG and ICMP protocol sockets and supports both IPv4 and IPv6 addressing.
69
69
70
70
```php
@@ -75,8 +75,8 @@ $factory = new \Socket\Raw\Factory();
75
75
76
76
The `createClient(string $address, null|float $timeout): Socket` method is
77
77
the most convenient method for creating connected client sockets
78
-
(similar to how [`fsockopen()`](http://www.php.net/manual/en/function.fsockopen.php) or
The `createServer($address)` method can be used to create a server side (listening) socket bound to specific address/path
110
-
(similar to how [`stream_socket_server()`](http://www.php.net/manual/en/function.stream-socket-server.php) works).
110
+
(similar to how [`stream_socket_server()`](https://www.php.net/manual/en/function.stream-socket-server.php) works).
111
111
It accepts the same addressing scheme as the [`createClient()`](#createclient) method.
112
112
113
113
```php
@@ -152,7 +152,7 @@ The recommended way to create a `Socket` instance is via the above [`Factory`](#
152
152
153
153
All low-level socket operations are available as methods on the `Socket` class.
154
154
155
-
You can refer to PHP's fairly good [socket API documentation](http://www.php.net/manual/en/ref.sockets.php) or the docblock comments in the [`Socket` class](src/Socket.php) to get you started.
155
+
You can refer to PHP's fairly good [socket API documentation](https://www.php.net/manual/en/ref.sockets.php) or the docblock comments in the [`Socket` class](src/Socket.php) to get you started.
156
156
157
157
##### Data I/O:
158
158
@@ -195,7 +195,7 @@ This project follows [SemVer](https://semver.org/).
195
195
This will install the latest supported version:
196
196
197
197
```bash
198
-
$ composer require clue/socket-raw:^1.4
198
+
$ composer require clue/socket-raw:^1.4.1
199
199
```
200
200
201
201
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
0 commit comments