Skip to content

Commit 691dbf6

Browse files
committed
Prepare v0.5.0 release
1 parent 8844d47 commit 691dbf6

File tree

2 files changed

+101
-5
lines changed

2 files changed

+101
-5
lines changed

CHANGELOG.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,105 @@
11
# Changelog
22

3+
## 0.5.0 (2017-02-14)
4+
5+
* Feature / BC break: Replace `listen()` call with URIs passed to constructor
6+
and reject listening on hostnames with `InvalidArgumentException`
7+
and replace `ConnectionException` with `RuntimeException` for consistency
8+
(#61, #66 and #72 by @clue)
9+
10+
```php
11+
// old
12+
$server = new Server($loop);
13+
$server->listen(8080);
14+
15+
// new
16+
$server = new Server(8080, $loop);
17+
```
18+
19+
Similarly, you can now pass a full listening URI to the constructor to change
20+
the listening host:
21+
22+
```php
23+
// old
24+
$server = new Server($loop);
25+
$server->listen(8080, '127.0.0.1');
26+
27+
// new
28+
$server = new Server('127.0.0.1:8080', $loop);
29+
```
30+
31+
Trying to start listening on (DNS) host names will now throw an
32+
`InvalidArgumentException`, use IP addresses instead:
33+
34+
```php
35+
// old
36+
$server = new Server($loop);
37+
$server->listen(8080, 'localhost');
38+
39+
// new
40+
$server = new Server('127.0.0.1:8080', $loop);
41+
```
42+
43+
If trying to listen fails (such as if port is already in use or port below
44+
1024 may require root access etc.), it will now throw a `RuntimeException`,
45+
the `ConnectionException` class has been removed:
46+
47+
```php
48+
// old: throws React\Socket\ConnectionException
49+
$server = new Server($loop);
50+
$server->listen(80);
51+
52+
// new: throws RuntimeException
53+
$server = new Server(80, $loop);
54+
```
55+
56+
* Feature / BC break: Rename `shutdown()` to `close()` for consistency throughout React
57+
(#62 by @clue)
58+
59+
```php
60+
// old
61+
$server->shutdown();
62+
63+
// new
64+
$server->close();
65+
```
66+
67+
* Feature / BC break: Replace `getPort()` with `getAddress()`
68+
(#67 by @clue)
69+
70+
```php
71+
// old
72+
echo $server->getPort(); // 8080
73+
74+
// new
75+
echo $server->getAddress(); // 127.0.0.1:8080
76+
```
77+
78+
* Feature / BC break: `getRemoteAddress()` returns full address instead of only IP
79+
(#65 by @clue)
80+
81+
```php
82+
// old
83+
echo $connection->getRemoteAddress(); // 192.168.0.1
84+
85+
// new
86+
echo $connection->getRemoteAddress(); // 192.168.0.1:51743
87+
```
88+
89+
* Feature / BC break: Add `getLocalAddress()` method
90+
(#68 by @clue)
91+
92+
```php
93+
echo $connection->getLocalAddress(); // 127.0.0.1:8080
94+
```
95+
96+
* BC break: The `Server` and `SecureServer` class are now marked `final`
97+
and you can no longer `extend` them
98+
(which was never documented or recommended anyway).
99+
Public properties and event handlers are now internal only.
100+
Please use composition instead of extension.
101+
(#71, #70 and #69 by @clue)
102+
3103
## 0.4.6 (2017-01-26)
4104

5105
* Feature: Support socket context options passed to `Server`

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ The socket component provides a more usable interface for a socket-layer
88
server based on the [`EventLoop`](https://github.com/reactphp/event-loop)
99
and [`Stream`](https://github.com/reactphp/stream) components.
1010

11-
> The master branch contains the code for the upcoming 0.5 release.
12-
For the code of the current stable 0.4.x release, checkout the
13-
[0.4 branch](https://github.com/reactphp/socket-client/tree/0.4).
14-
1511
**Table of Contents**
1612

1713
* [Quickstart example](#quickstart-example)
@@ -415,7 +411,7 @@ The recommended way to install this library is [through Composer](http://getcomp
415411
This will install the latest supported version:
416412

417413
```bash
418-
$ composer require react/socket:^0.4.6
414+
$ composer require react/socket:^0.5
419415
```
420416

421417
More details about version upgrades can be found in the [CHANGELOG](CHANGELOG.md).

0 commit comments

Comments
 (0)