Commit Graph

324 Commits

Author SHA1 Message Date
Damien Arrachequesne
95ecf222d2 fix: prevent socket from reconnecting after middleware failure
See also: d54d12ce63
2022-07-10 22:59:57 +02:00
Damien Arrachequesne
ee35261dc0 chore: bump engine.io-client to version 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
Release notes: https://github.com/socketio/engine.io-client-java/releases/tag/engine.io-client-2.1.0
2022-07-10 09:37:10 +02:00
Damien Arrachequesne
4f932f278c docs: how to map the event arguments to POJO
Related: https://github.com/socketio/socket.io-client-java/issues/235
2022-07-10 08:15:54 +02:00
Damien Arrachequesne
c7d50b8ae9 feat: implement catch-all listeners
Syntax:

```java
socket.onAnyIncoming(new Emitter.Listener() {
    @Override
    public void call(Object... args) {
        // ...
    }
});

socket.onAnyOutgoing(new Emitter.Listener() {
    @Override
    public void call(Object... args) {
        // ...
    }
});
```

Related:

- https://github.com/socketio/engine.io-client-java/issues/99
- https://github.com/socketio/socket.io-client-java/issues/243
- https://github.com/socketio/socket.io-client-java/issues/475
2022-07-08 20:39:36 +02:00
Damien Arrachequesne
fca3b9507d feat: emit with timeout
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) {
        // ...
    }
});
```

Related:

- https://github.com/socketio/socket.io-client-java/issues/309
- https://github.com/socketio/socket.io-client-java/pull/517
2022-07-08 19:46:18 +02:00
Damien Arrachequesne
73757635ed docs: multiplexing
Related: https://github.com/socketio/socket.io-client-java/pull/716
2022-07-08 09:26:40 +02:00
Damien Arrachequesne
6e08d1fe3b docs: how to properly close a client
Related:

- https://github.com/socketio/socket.io-client-java/issues/547
- https://github.com/socketio/socket.io-client-java/issues/704
2022-07-08 08:46:11 +02:00
Damien Arrachequesne
f3221a4cdf docs: how to create a lot of clients
Related:

- https://github.com/socketio/socket.io-client-java/issues/460
- https://github.com/socketio/socket.io-client-java/issues/618
2022-07-07 08:53:33 +02:00
Damien Arrachequesne
d178f31f53 docs: add note about TLS versions
Related: https://github.com/socketio/socket.io-client-java/issues/298
2022-07-07 08:10:39 +02:00
Damien Arrachequesne
b43819e986 docs: how to display the debug logs
Related: https://github.com/socketio/socket.io-client-java/issues/498
2022-07-06 09:33:14 +02:00
Damien Arrachequesne
de7f932918 docs: add note about the readTimeout value
See also: fb531fab30
2022-07-04 02:54:11 +02:00
Damien Arrachequesne
98d0c13da1 docs: add missing manager options 2022-07-04 02:50:00 +02:00
Damien Arrachequesne
18b2fca397 docs: init Android documentation
Related:

- https://github.com/socketio/socket.io-client-java/issues/606
- https://github.com/socketio/socket.io-client-java/issues/435
2022-07-04 02:37:51 +02:00
Damien Arrachequesne
0cbf01eb25 fix: ensure randomizationFactor is always between 0 and 1
Using a randomizationFactor value above 1 could lead to generating a
negative duration, then throwing:

> java.lang.IllegalArgumentException: delay < 0: -1012
> at java.util.Timer.schedule(Timer.java:454)
> at io.socket.client.Manager.reconnect(Manager.java:544)

This error does not seem related to a long overflow (in the
BigInteger.longValue() operation), because the BigInteger.min(this.max)
operation before should prevent it.

Related: https://github.com/socketio/socket.io-client-java/issues/349
2022-07-02 09:02:48 +02:00
Damien Arrachequesne
fd0c733822 docs: add "How to deal with cookies" in FAQ 2022-07-02 07:26:20 +02:00
Damien Arrachequesne
891bea342f test: add test class (2)
Let's use Java 7 syntax for now.
2022-07-02 07:24:33 +02:00
Damien Arrachequesne
d7ff2bbca5 test: add test class 2022-06-29 08:20:39 +02:00
Damien Arrachequesne
072d894dab docs: add changelog for version 2.0.1 2022-06-29 07:36:21 +02:00
Damien Arrachequesne
7fa9e9595b docs: add SSL examples 2022-06-29 07:27:11 +02:00
Damien Arrachequesne
d97f4573be docs: add example with server to client ack
Related: https://github.com/socketio/socket.io-client-java/issues/693
2021-11-24 16:20:57 +01:00
Damien Arrachequesne
d8d975e5bd docs: update links to the Socket.IO website
Some links were broken due to recent updates.
2021-09-21 08:34:33 +02:00
Damien Arrachequesne
08bc462ccd docs: use implementation instead of compile in gradle (#684)
Reference: https://docs.gradle.org/current/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
2021-09-21 08:28:30 +02:00
Damien Arrachequesne
ad23cfcca6 chore(release): prepare for next development iteration 2021-04-27 00:35:37 +02:00
Damien Arrachequesne
b46da92382 chore(release): prepare release socket.io-client-2.0.1 2021-04-27 00:30:03 +02:00
Damien Arrachequesne
d324e7f396 fix: emit a CONNECT_ERROR event upon connection failure
See also: 53c73749a8
2021-04-27 00:17:05 +02:00
Damien Arrachequesne
e8ffe9d138 fix: ensure the payload format is valid
This commit should prevent some NPE issues encountered after the
parsing of the packet.

Related:

- https://github.com/socketio/socket.io-client-java/issues/642
- https://github.com/socketio/socket.io-client-java/issues/609
- https://github.com/socketio/socket.io-client-java/issues/505
2021-04-27 00:14:24 +02:00
Damien Arrachequesne
4885e7d59f fix: ensure buffered events are sent in order
Before this commit, an event sent in the "connect" handler could be
sent before the events that were buffered while disconnected.

Related: https://github.com/socketio/socket.io-client/issues/1458
2021-04-27 00:12:46 +02:00
Damien Arrachequesne
48fec45740 refactor: minor cleanup
- replace explicit types by <>
- remove unnecessary interface modifiers
2021-04-26 11:19:02 +02:00
Damien Arrachequesne
a4053e8645 test: cleanup URISyntaxException exceptions
Note: we cannot update the `IO.socket(uri: string)` method without
doing a breaking change.
2021-04-26 11:19:02 +02:00
Damien Arrachequesne
67fd5f34a3 fix: fix usage with ws:// scheme
The URL constructor does not support the ws:// scheme, and would throw:

> java.net.MalformedURLException: unknown protocol: ws

Related:

- https://github.com/socketio/socket.io-client-java/issues/650
- https://github.com/socketio/socket.io-client-java/issues/555
- https://github.com/socketio/socket.io-client-java/issues/233
2021-04-26 11:17:41 +02:00
Damien Arrachequesne
e2e24ea75d docs: update compatibility table with Socket.IO v4 2021-04-26 09:22:05 +02:00
Damien Arrachequesne
5b5b91cb01 test: fix random test failures 2021-04-26 09:12:55 +02:00
Damien Arrachequesne
615942b828 docs: update compatibility table with Socket.IO v4
There is no breaking change at the protocol level.

Reference: https://socket.io/blog/socket-io-4-release/
2021-03-19 14:55:42 +01:00
Damien Arrachequesne
275cd1b7ee docs: add EVENT_CONNECT_TIMEOUT in the migration guide 2020-12-21 10:37:49 +01:00
Damien Arrachequesne
651404136f docs: add additional details
Adapted from:

- https://socket.io/docs/v3/client-initialization/
- https://socket.io/docs/v3/client-socket-instance/
2020-12-21 10:08:02 +01:00
Damien Arrachequesne
90d0d4e031 chore: add issue templates 2020-12-17 16:01:50 +01:00
Damien Arrachequesne
aeecf9ecac docs: add "emitting and listening to events" pages
Imported from the javascript documentation:

- https://socket.io/docs/v3/emitting-events/
- https://socket.io/docs/v3/listening-to-events/
2020-12-16 01:55:30 +01:00
Damien Arrachequesne
dee6bb97b3 docs: remove notice of incompatibility with v3 2020-12-16 00:39:39 +01:00
Damien Arrachequesne
6a2e0f493d docs: init migration guide 2020-12-16 00:17:43 +01:00
Damien Arrachequesne
4627329ab0 chore(release): prepare for next development iteration 2020-12-15 09:28:12 +01:00
Damien Arrachequesne
75d7bb5918 chore(release): prepare release socket.io-client-2.0.0 2020-12-15 00:32:37 +01:00
Damien Arrachequesne
a857b9baa4 docs: update website 2020-12-15 00:26:37 +01:00
Lloyd Junbong Lee
49068d3cc5 feat: add options builder (#304) 2020-12-15 00:16:59 +01:00
Damien Arrachequesne
79cb27fc97 feat: add support for Socket.IO v3
Including:

- 969debe88c
- 6494f61be0
- 132f8ec918
- f8f60fc860

Reference: https://github.com/socketio/socket.io-protocol#difference-between-v5-and-v4
2020-12-15 00:05:22 +01:00
Damien Arrachequesne
48bf83f34c chore(release): prepare for next development iteration 2020-12-10 16:02:02 +01:00
Damien Arrachequesne
89ef9d09ce chore(release): prepare release socket.io-client-1.0.1 2020-12-10 16:01:09 +01:00
Damien Arrachequesne
9df7b759b0 chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client-java/compare/engine.io-client-1.0.0...engine.io-client-1.0.1
2020-12-10 15:43:05 +01:00
Damien Arrachequesne
7cb4dc9316 chore: bump Socket.IO server version
We'll migrate to v3 in a second time.
2020-12-10 15:43:05 +01:00
Damien Arrachequesne
b733f96e0e test: fix test with ping-pong latency
Randomly receiving a latency of 0 ms would make the test fail.
2020-12-10 12:23:33 +01:00
Alireza Ghaffari
567372ecfa fix: handle case where URI.getHost() returns null (#484)
It seems that URI.getHost() might return null on some Samsung devices.

Related: https://stackoverflow.com/questions/39645789/android-websocket-connection-failed-galaxy-s4
2020-12-10 12:20:06 +01:00