Comments (10)
Same problem here ¿Any solution?
from socket.io-client-java.
When and where does the error happen? Any logs?
from socket.io-client-java.
In my case it's happen randomly, the timeout event of the library it's ok, but this i can't catch, for the record i'm using ssl:
Edit: after the connection it's stabilished if i stop the server i receive the timeout events of the library except this that happen after 90000ms.
FATAL EXCEPTION: Thread-3160
java.lang.AssertionError: java.net.SocketTimeoutException: failed to connect to /192.168.1.97 (port 443) after 90000ms
at libcore.io.IoBridge.connect(IoBridge.java:102)
at java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:177)
at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:210)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:188)
at java.lang.Thread.run(Thread.java:838)
Caused by: java.net.SocketTimeoutException: failed to connect to /192.168.1.97 (port 443) after 90000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:176)
at libcore.io.IoBridge.connect(IoBridge.java:112)
at libcore.io.IoBridge.connect(IoBridge.java:100)
... 4 more
from socket.io-client-java.
It looks like the error originally came from the following (the source of android):
And unfortunately, as I see the source of org.java_websocket.client.WebSocketClient.interruptableRun
, we have no chance to catch this exception ...
from socket.io-client-java.
I had the same problem in the version 1.3.0.
I downloaded the source and fixed it by my own.
In org/java_websocket/client/WebSocketClient.java there is interruptableRun() function (194 line).
In this function, at the line 220 I added:
catch (java.lang.AssertionError e ) {
onWebsocketError( conn, new Exception(e.getMessage()) );
conn.closeConnection( CloseFrame.NEVER_CONNECTED, e.getMessage() );
return;
}
That's all
from socket.io-client-java.
@ivankovalchuk I wonder why adding this catch block solved the issue, because line 220 in WebSocketClient.java should already catch every exception:
} catch ( /*IOException | SecurityException | UnresolvedAddressException*/Exception e ) {//
Or am I misreading the code? Is the comment in that line not just a comment?
from socket.io-client-java.
Close this? As it related with java_websocket, which is not a dependency to this project. @nkzawa
from socket.io-client-java.
skleeschulte, java.lang.AssertionError is not an instance of Exception.
So we have to add another "catch"
Sorry for the late answer, unfortunately I haven't noticed your question before.
from socket.io-client-java.
ok, I see
from socket.io-client-java.
09-17 19:10:57.744 20629-24789/.... E/AndroidRuntime﹕ FATAL EXCEPTION: EventThread
Process: com.oneononedevelopment.matov, PID: 20629
java.lang.IllegalArgumentException: delay < 0: -432345566375051264
at java.util.Timer.schedule(Timer.java:454)
at com.github.nkzawa.socketio.client.Manager.reconnect(Manager.java:497)
at com.github.nkzawa.socketio.client.Manager.access$2000(Manager.java:20)
at com.github.nkzawa.socketio.client.Manager$8$1$1.call(Manager.java:519)
at com.github.nkzawa.socketio.client.Manager$1$3.call(Manager.java:282)
at com.github.nkzawa.emitter.Emitter.emit(Emitter.java:117)
at com.github.nkzawa.engineio.client.Socket.onError(Socket.java:754)
at com.github.nkzawa.engineio.client.Socket.access$800(Socket.java:29)
at com.github.nkzawa.engineio.client.Socket$4.call(Socket.java:293)
at com.github.nkzawa.emitter.Emitter.emit(Emitter.java:117)
at com.github.nkzawa.engineio.client.Transport.onError(Transport.java:63)
at com.github.nkzawa.engineio.client.transports.PollingXHR.access$100(PollingXHR.java:19)
at com.github.nkzawa.engineio.client.transports.PollingXHR$6$1.run(PollingXHR.java:126)
at com.github.nkzawa.thread.EventThread$2.run(EventThread.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
I got this error after some time of connection with server.
from socket.io-client-java.
Related Issues (20)
- socket.io client sometimes sends arrays wrong HOT 5
- can i use multiple socket connection ?
- Android 13 not available HOT 1
- It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible HOT 3
- sendBuffer should be accessible
- Getting EVENT_CONNECT_ERROR from Android to Node HOT 1
- Change/update auth or query or extraheaders containing token after connection HOT 1
- Is this project Still Alive? HOT 3
- How to listen to Manager events? (Socket events are working) HOT 2
- Straightforward logging option for Android
- testDecodeError function in Helpers.java error message clean up HOT 2
- Report: ConcurrentModificationException when use AckWithTimout... HOT 2
- Connection state recovery HOT 1
- NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference HOT 1
- Unable to emit JSON object instead it is emitting Stringified Json in Client Version - 1.0.2 HOT 2
- Implement Connection State Recovery
- it throws java.lang.ClassCastException when sending nested json data. HOT 1
- in the this one the depencies are not dwonloading for me
- Android 14 not compatible with version 2.1.0
- received disconnect event. and socket closed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io-client-java.