Skip to content

Commit abe22c3

Browse files
chore(release): prepare release socket.io-client-2.1.0
1 parent 95ecf22 commit abe22c3

File tree

6 files changed

+152
-4
lines changed

6 files changed

+152
-4
lines changed

History.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
2.1.0 / 2022-07-10
3+
==================
4+
5+
### Bug Fixes
6+
7+
* ensure randomizationFactor is always between 0 and 1 ([0cbf01e](https://github.com/socketio/socket.io-client-java/commit/0cbf01eb2501b3098eacd22594966a719b20c31e))
8+
* prevent socket from reconnecting after middleware failure ([95ecf22](https://github.com/socketio/socket.io-client-java/commit/95ecf222d25de390d8c0f2ffade37b608cf448eb))
9+
* increase the readTimeout value of the default OkHttpClient ([fb531fa](https://github.com/socketio/engine.io-client-java/commit/fb531fab30968a4b65a402c81f37e92dd5671f33)) (from `engine.io-client`)
10+
11+
### Features
12+
13+
* emit with timeout ([fca3b95](https://github.com/socketio/socket.io-client-java/commit/fca3b9507d5bc79d3c41ab6e119efccd23669ca6))
14+
15+
This feature allows to send a packet and expect an acknowledgement from the server within the given delay.
16+
17+
Syntax:
18+
19+
```java
20+
socket.emit("hello", "world", new AckWithTimeout(5000) {
21+
@Override
22+
public void onTimeout() {
23+
// ...
24+
}
25+
26+
@Override
27+
public void onSuccess(Object... args) {
28+
// ...
29+
}
30+
});
31+
```
32+
33+
* implement catch-all listeners ([c7d50b8](https://github.com/socketio/socket.io-client-java/commit/c7d50b8ae9787e9ebdff50aa5d36f88433fc50b9))
34+
35+
Syntax:
36+
37+
```java
38+
socket.onAnyIncoming(new Emitter.Listener() {
39+
@Override
40+
public void call(Object... args) {
41+
// ...
42+
}
43+
});
44+
45+
socket.onAnyOutgoing(new Emitter.Listener() {
46+
@Override
47+
public void call(Object... args) {
48+
// ...
49+
}
50+
});
51+
```
52+
53+
254
2.0.1 / 2021-04-27
355
==================
456

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>io.socket</groupId>
44
<artifactId>socket.io-client</artifactId>
5-
<version>2.0.2-SNAPSHOT</version>
5+
<version>2.1.0</version>
66
<packaging>jar</packaging>
77
<name>socket.io-client</name>
88
<description>Socket.IO Client Library for Java</description>
@@ -30,7 +30,7 @@
3030
<url>https://github.com/socketio/socket.io-client-java</url>
3131
<connection>scm:git:https://github.com/socketio/socket.io-client-java.git</connection>
3232
<developerConnection>scm:git:https://github.com/socketio/socket.io-client-java.git</developerConnection>
33-
<tag>HEAD</tag>
33+
<tag>socket.io-client-2.1.0</tag>
3434
</scm>
3535

3636
<developers>

src/site/markdown/changelog.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,57 @@
11

2+
## [2.1.0](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.1...socket.io-client-2.1.0) (2022-07-10)
3+
4+
5+
### Bug Fixes
6+
7+
* ensure randomizationFactor is always between 0 and 1 ([0cbf01e](https://github.com/socketio/socket.io-client-java/commit/0cbf01eb2501b3098eacd22594966a719b20c31e))
8+
* prevent socket from reconnecting after middleware failure ([95ecf22](https://github.com/socketio/socket.io-client-java/commit/95ecf222d25de390d8c0f2ffade37b608cf448eb))
9+
* increase the readTimeout value of the default OkHttpClient ([fb531fa](https://github.com/socketio/engine.io-client-java/commit/fb531fab30968a4b65a402c81f37e92dd5671f33)) (from `engine.io-client`)
10+
11+
### Features
12+
13+
* emit with timeout ([fca3b95](https://github.com/socketio/socket.io-client-java/commit/fca3b9507d5bc79d3c41ab6e119efccd23669ca6))
14+
15+
This feature allows to send a packet and expect an acknowledgement from the server within the given delay.
16+
17+
Syntax:
18+
19+
```java
20+
socket.emit("hello", "world", new AckWithTimeout(5000) {
21+
@Override
22+
public void onTimeout() {
23+
// ...
24+
}
25+
26+
@Override
27+
public void onSuccess(Object... args) {
28+
// ...
29+
}
30+
});
31+
```
32+
33+
* implement catch-all listeners ([c7d50b8](https://github.com/socketio/socket.io-client-java/commit/c7d50b8ae9787e9ebdff50aa5d36f88433fc50b9))
34+
35+
Syntax:
36+
37+
```java
38+
socket.onAnyIncoming(new Emitter.Listener() {
39+
@Override
40+
public void call(Object... args) {
41+
// ...
42+
}
43+
});
44+
45+
socket.onAnyOutgoing(new Emitter.Listener() {
46+
@Override
47+
public void call(Object... args) {
48+
// ...
49+
}
50+
});
51+
```
52+
53+
54+
255
## [2.0.1](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.0...socket.io-client-2.0.1) (2021-04-27)
356

457

src/site/markdown/emitting_events.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,21 @@ socket.on("hello", args -> {
146146
}
147147
});
148148
```
149+
150+
## With timeout
151+
152+
Starting with version `2.1.0`, you can now assign a timeout to each emit:
153+
154+
```java
155+
socket.emit("hello", "world", new AckWithTimeout(5000) {
156+
@Override
157+
public void onTimeout() {
158+
// ...
159+
}
160+
161+
@Override
162+
public void onSuccess(Object... args) {
163+
// ...
164+
}
165+
});
166+
```

src/site/markdown/installation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Add the following dependency to your `pom.xml`.
1717
<dependency>
1818
<groupId>io.socket</groupId>
1919
<artifactId>socket.io-client</artifactId>
20-
<version>2.0.1</version>
20+
<version>2.1.0</version>
2121
</dependency>
2222
</dependencies>
2323
```
@@ -26,7 +26,7 @@ Add the following dependency to your `pom.xml`.
2626
Add it as a gradle dependency for Android Studio, in `build.gradle`:
2727

2828
```groovy
29-
implementation ('io.socket:socket.io-client:2.0.1') {
29+
implementation ('io.socket:socket.io-client:2.1.0') {
3030
// excluding org.json which is provided by Android
3131
exclude group: 'org.json', module: 'json'
3232
}
@@ -36,6 +36,7 @@ implementation ('io.socket:socket.io-client:2.0.1') {
3636

3737
| `socket.io-client` | `engine.io-client` | `okhttp` |
3838
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
39+
| `2.1.0` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.1...socket.io-client-2.1.0)) | `2.1.0` ([diff](https://github.com/socketio/engine.io-client-java/compare/engine.io-client-2.0.0...engine.io-client-2.1.0)) | `3.12.12` |
3940
| `2.0.1` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.0...socket.io-client-2.0.1)) | `2.0.0` | `3.12.12` |
4041
| `2.0.0` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-1.0.1...socket.io-client-2.0.0)) | `2.0.0` ([diff](https://github.com/socketio/engine.io-client-java/compare/engine.io-client-1.0.1...engine.io-client-2.0.0)) | `3.12.12` |
4142
| `1.0.1` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-1.0.0...socket.io-client-1.0.1)) | `1.0.1` ([diff](https://github.com/socketio/engine.io-client-java/compare/engine.io-client-1.0.0...engine.io-client-1.0.1)) | `3.12.12` ([changelog](https://square.github.io/okhttp/changelogs/changelog_3x/#version-31212)) |

src/site/markdown/listening_to_events.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,27 @@ Removes all listeners (for any event).
6969
```java
7070
socket.off();
7171
```
72+
73+
## Catch-all listeners
74+
75+
### For incoming packets
76+
77+
```java
78+
socket.onAnyIncoming(new Emitter.Listener() {
79+
@Override
80+
public void call(Object... args) {
81+
// ...
82+
}
83+
});
84+
```
85+
86+
### For outgoing packets
87+
88+
```java
89+
socket.onAnyOutgoing(new Emitter.Listener() {
90+
@Override
91+
public void call(Object... args) {
92+
// ...
93+
}
94+
});
95+
```

0 commit comments

Comments
 (0)