You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.
socket = new SocketIO();
socket.connect("http://10.0.0.71:9092", this);// local ip address
// Sends a string to the server.
socket.send("Hello Server");
// Sends a JSON object to the server.
socket.send(new JSONObject().put("key", "value").put("key2",
"another value"));
// Emits an event to the server.
socket.emit("event", "argument1", "argument2", 13.37);
}
While using this code for creating server connection and by using socket.io.jar v1.0.
I get the following error
io.socket.SocketIOException: Error while handshaking
at io.socket.IOConnection.handshake(IOConnection.java:322)
at io.socket.IOConnection.access$600(IOConnection.java:39)
at io.socket.IOConnection$ConnectThread.run(IOConnection.java:199)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
The text was updated successfully, but these errors were encountered:
Try adding following line to your AndroidManifest.xml file. This should solve the connection error but if you are using socket.io 1.0.x this library won't work. I added @francoisTemasys's fork as a dependency and everything worked like a charm.
socket = new SocketIO();
socket.connect("http://10.0.0.71:9092", this);// local ip address
}
While using this code for creating server connection and by using socket.io.jar v1.0.
I get the following error
io.socket.SocketIOException: Error while handshaking
at io.socket.IOConnection.handshake(IOConnection.java:322)
at io.socket.IOConnection.access$600(IOConnection.java:39)
at io.socket.IOConnection$ConnectThread.run(IOConnection.java:199)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
The text was updated successfully, but these errors were encountered: