Open oliTheTM opened 2 years ago
False-Positive?
Hi! Do you know the version of the server? You can check the compatibility table here: https://socketio.github.io/socket.io-client-java/installation.html
Regarding your reconnection logic, you can listen to the events sent by the underlying Manager:
public class Fiddle {
public static void main(String[] argz) {
IO.Options options = IO.Options.builder()
.setReconnectionAttempts(10)
.build();
final Socket socket = IO.socket(URI.create("http://localhost:8080"), options);
socket.io().on(Manager.EVENT_RECONNECT_ERROR, (args) -> {
// reconnection attempt has failed
});
socket.io().on(Manager.EVENT_RECONNECT_FAILED, (args) -> {
// all reconnection attempts have failed
});
socket.connect();
}
}
Hi! Do you know the version of the server? You can check the compatibility table here: https://socketio.github.io/socket.io-client-java/installation.html
Regarding your reconnection logic, you can listen to the events sent by the underlying Manager:
public class Fiddle { public static void main(String[] argz) { IO.Options options = IO.Options.builder() .setReconnectionAttempts(10) .build(); final Socket socket = IO.socket(URI.create("http://localhost:8080"), options); socket.io().on(Manager.EVENT_RECONNECT_ERROR, (args) -> { // reconnection attempt has failed }); socket.io().on(Manager.EVENT_RECONNECT_FAILED, (args) -> { // all reconnection attempts have failed }); socket.connect(); } }
Sorry, I don't know the version of the associated server. I'll try out those extra listeners to see what new information they can provide.
Thanks.
Ok, so I applied the following 2 listeners to client
which is of type Socket
:
client.io().on(Manager.EVENT_RECONNECT_ERROR, (args) -> {
StringBuilder fold = new StringBuilder();
LOG.info("*WEBSOCKET RECONNECT ERROR*:");
for (Object arg : args) {
if (arg.getClass().isPrimitive())
fold.append(arg.toString());
else if (arg instanceof String)
fold.append((String)arg);
}
LOG.info(fold.toString());
});
client.io().on(Manager.EVENT_RECONNECT_FAILED, (args) -> {
StringBuilder fold = new StringBuilder();
LOG.info("*WEBSOCKET RECONNECT FAILED ERROR*:");
for (Object arg : args) {
if (arg.getClass().isPrimitive())
fold.append(arg.toString());
else if (arg instanceof String)
fold.append((String)arg);
}
LOG.info(fold.toString());
});
However, I didn't receive any new information; instead, I get the same vague server error
:
Apr 23, 2022 12:35:15 PM domain.actors.CaseWorker$Callback connect
INFO: *1st ATTEMPT TO ESTABLISH WEBSOCKET WITH CaseWorker (sit)* ...
Apr 23, 2022 12:35:16 PM domain.actors.CaseWorker$Callback lambda$_connect$3
INFO: *CaseWorker (sit) WEBSOCKET CONNECTION ERROR*:
server error
Apr 23, 2022 12:35:16 PM domain.actors.CaseWorker$Callback connect
INFO: *2nd ATTEMPT TO ESTABLISH WEBSOCKET WITH CaseWorker (sit)* ...
Apr 23, 2022 12:35:17 PM domain.actors.CaseWorker$Callback lambda$_connect$3
INFO: *CaseWorker (sit) WEBSOCKET CONNECTION ERROR*:
server error
Etc..
Any idea how I can uncover the root cause?? @bazza @mdawaffe @lu-zero @b95505017 @pamepros
Is anyone there??... -___-
client.io().on(Manager.EVENT_RECONNECT_ERROR, (args) -> { StringBuilder fold = new StringBuilder(); LOG.info("WEBSOCKET RECONNECT ERROR:"); for (Object arg : args) { if (arg.getClass().isPrimitive()) fold.append(arg.toString()); else if (arg instanceof String) fold.append((String)arg); } LOG.info(fold.toString()); });
Hi,I have a question about your code:
you create
StringBuilder fold = new StringBuilder();
in socket.on()
have you tried creating a global variable to append these args? @oliTheTM
Describe the bug I continuously get a generic error upon attempting to connect with a simple socket.io implemented server; as a client. The error is:
server error
.To Reproduce Server Socket.IO server version:
unknown
Client Socket.IO java client version:
2.0.1
Then, this class is applied in another class:
Expected behavior Should, at least, successfully connect.
Platform:
Additional context I am only trying to 'listen' on 1 event
joinRoom
. Then I literally just wait until some new record pattern-matchescaseUpdated
.