chore(release): prepare release socket.io-client-2.1.0

This commit is contained in:
Damien Arrachequesne
2022-07-10 23:15:59 +02:00
parent 95ecf222d2
commit abe22c3779
6 changed files with 152 additions and 4 deletions

View File

@@ -1,4 +1,56 @@
2.1.0 / 2022-07-10
==================
### Bug Fixes
* ensure randomizationFactor is always between 0 and 1 ([0cbf01e](https://github.com/socketio/socket.io-client-java/commit/0cbf01eb2501b3098eacd22594966a719b20c31e))
* prevent socket from reconnecting after middleware failure ([95ecf22](https://github.com/socketio/socket.io-client-java/commit/95ecf222d25de390d8c0f2ffade37b608cf448eb))
* increase the readTimeout value of the default OkHttpClient ([fb531fa](https://github.com/socketio/engine.io-client-java/commit/fb531fab30968a4b65a402c81f37e92dd5671f33)) (from `engine.io-client`)
### Features
* emit with timeout ([fca3b95](https://github.com/socketio/socket.io-client-java/commit/fca3b9507d5bc79d3c41ab6e119efccd23669ca6))
This feature allows to send a packet and expect an acknowledgement from the server within the given delay.
Syntax:
```java
socket.emit("hello", "world", new AckWithTimeout(5000) {
@Override
public void onTimeout() {
// ...
}
@Override
public void onSuccess(Object... args) {
// ...
}
});
```
* implement catch-all listeners ([c7d50b8](https://github.com/socketio/socket.io-client-java/commit/c7d50b8ae9787e9ebdff50aa5d36f88433fc50b9))
Syntax:
```java
socket.onAnyIncoming(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
socket.onAnyOutgoing(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
```
2.0.1 / 2021-04-27 2.0.1 / 2021-04-27
================== ==================

View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>io.socket</groupId> <groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId> <artifactId>socket.io-client</artifactId>
<version>2.0.2-SNAPSHOT</version> <version>2.1.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>socket.io-client</name> <name>socket.io-client</name>
<description>Socket.IO Client Library for Java</description> <description>Socket.IO Client Library for Java</description>
@@ -30,7 +30,7 @@
<url>https://github.com/socketio/socket.io-client-java</url> <url>https://github.com/socketio/socket.io-client-java</url>
<connection>scm:git:https://github.com/socketio/socket.io-client-java.git</connection> <connection>scm:git:https://github.com/socketio/socket.io-client-java.git</connection>
<developerConnection>scm:git:https://github.com/socketio/socket.io-client-java.git</developerConnection> <developerConnection>scm:git:https://github.com/socketio/socket.io-client-java.git</developerConnection>
<tag>HEAD</tag> <tag>socket.io-client-2.1.0</tag>
</scm> </scm>
<developers> <developers>

View File

@@ -1,4 +1,57 @@
## [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)
### Bug Fixes
* ensure randomizationFactor is always between 0 and 1 ([0cbf01e](https://github.com/socketio/socket.io-client-java/commit/0cbf01eb2501b3098eacd22594966a719b20c31e))
* prevent socket from reconnecting after middleware failure ([95ecf22](https://github.com/socketio/socket.io-client-java/commit/95ecf222d25de390d8c0f2ffade37b608cf448eb))
* increase the readTimeout value of the default OkHttpClient ([fb531fa](https://github.com/socketio/engine.io-client-java/commit/fb531fab30968a4b65a402c81f37e92dd5671f33)) (from `engine.io-client`)
### Features
* emit with timeout ([fca3b95](https://github.com/socketio/socket.io-client-java/commit/fca3b9507d5bc79d3c41ab6e119efccd23669ca6))
This feature allows to send a packet and expect an acknowledgement from the server within the given delay.
Syntax:
```java
socket.emit("hello", "world", new AckWithTimeout(5000) {
@Override
public void onTimeout() {
// ...
}
@Override
public void onSuccess(Object... args) {
// ...
}
});
```
* implement catch-all listeners ([c7d50b8](https://github.com/socketio/socket.io-client-java/commit/c7d50b8ae9787e9ebdff50aa5d36f88433fc50b9))
Syntax:
```java
socket.onAnyIncoming(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
socket.onAnyOutgoing(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
```
## [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) ## [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)

View File

@@ -146,3 +146,21 @@ socket.on("hello", args -> {
} }
}); });
``` ```
## With timeout
Starting with version `2.1.0`, you can now assign a timeout to each emit:
```java
socket.emit("hello", "world", new AckWithTimeout(5000) {
@Override
public void onTimeout() {
// ...
}
@Override
public void onSuccess(Object... args) {
// ...
}
});
```

View File

@@ -17,7 +17,7 @@ Add the following dependency to your `pom.xml`.
<dependency> <dependency>
<groupId>io.socket</groupId> <groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId> <artifactId>socket.io-client</artifactId>
<version>2.0.1</version> <version>2.1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
``` ```
@@ -26,7 +26,7 @@ Add the following dependency to your `pom.xml`.
Add it as a gradle dependency for Android Studio, in `build.gradle`: Add it as a gradle dependency for Android Studio, in `build.gradle`:
```groovy ```groovy
implementation ('io.socket:socket.io-client:2.0.1') { implementation ('io.socket:socket.io-client:2.1.0') {
// excluding org.json which is provided by Android // excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json' exclude group: 'org.json', module: 'json'
} }
@@ -36,6 +36,7 @@ implementation ('io.socket:socket.io-client:2.0.1') {
| `socket.io-client` | `engine.io-client` | `okhttp` | | `socket.io-client` | `engine.io-client` | `okhttp` |
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| |-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| `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` |
| `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` | | `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` |
| `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` | | `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` |
| `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)) | | `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)) |

View File

@@ -69,3 +69,27 @@ Removes all listeners (for any event).
```java ```java
socket.off(); socket.off();
``` ```
## Catch-all listeners
### For incoming packets
```java
socket.onAnyIncoming(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
```
### For outgoing packets
```java
socket.onAnyOutgoing(new Emitter.Listener() {
@Override
public void call(Object... args) {
// ...
}
});
```