Skip to content

Commit

Permalink
chore(release): prepare release socket.io-client-2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jul 10, 2022
1 parent 95ecf22 commit abe22c3
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 4 deletions.
52 changes: 52 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -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
==================

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0</version>
<packaging>jar</packaging>
<name>socket.io-client</name>
<description>Socket.IO Client Library for Java</description>
Expand Down Expand Up @@ -30,7 +30,7 @@
<url>https://github.com/socketio/socket.io-client-java</url>
<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>
<tag>HEAD</tag>
<tag>socket.io-client-2.1.0</tag>
</scm>

<developers>
Expand Down
53 changes: 53 additions & 0 deletions src/site/markdown/changelog.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
18 changes: 18 additions & 0 deletions src/site/markdown/emitting_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// ...
}
});
```
5 changes: 3 additions & 2 deletions src/site/markdown/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add the following dependency to your `pom.xml`.
<dependency>
<groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>
</dependency>
</dependencies>
```
Expand All @@ -26,7 +26,7 @@ Add the following dependency to your `pom.xml`.
Add it as a gradle dependency for Android Studio, in `build.gradle`:

```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
exclude group: 'org.json', module: 'json'
}
Expand All @@ -36,6 +36,7 @@ implementation ('io.socket:socket.io-client:2.0.1') {

| `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.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)) |
Expand Down
24 changes: 24 additions & 0 deletions src/site/markdown/listening_to_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,27 @@ Removes all listeners (for any event).
```java
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) {
// ...
}
});
```

0 comments on commit abe22c3

Please sign in to comment.