We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server:
"socket.io": "4.5.2", "socket.io-client": "4.5.2",
JS/Postman client connects correctly to server. Kotlin client does nothing. No callbacks are executed, socket.connected stays false.
socket.connected
false
jvm: openjdk-18.0.1.1 paltform/os: ubuntu 21.10 (it's not Android client)
import io.socket.client.IO import io.socket.client.Socket import java.net.URI class ServiceEndpoint() { private var socket: Socket private var uri: URI = URI.create("ws://localhost:3333/") init { var options = IO.Options.builder().build() socket = IO.socket(uri, options) socket.on(Socket.EVENT_CONNECT) { println("Socket connected!") } socket.on(Socket.EVENT_CONNECT_ERROR) {args -> println("connection failed: $args")} socket.io().on(Manager.EVENT_ERROR) { args -> println("error: $args")} } fun run(){ socket.connect() socket.emit("status", "hello") } }
The text was updated successfully, but these errors were encountered:
@prodrive11 try adding socket.open() after socket = IO.socket(uri, options)
socket.open()
socket = IO.socket(uri, options)
Sorry, something went wrong.
Update initialization.md
1bcf077
Adds `socket.open()` line which is needed to connect to the server. Closes `https://github.com/socketio/socket.io-client-java/issues/725` and prevents future similar issues.
Add socket.open() to emitting_events.md
f8827cb
Adds socket.open() line which is needed to connect to the server. Closes socketio#725 and prevents future similar issues.
Successfully merging a pull request may close this issue.
Server:
JS/Postman client connects correctly to server.
Kotlin client does nothing. No callbacks are executed,
socket.connected
staysfalse
.jvm: openjdk-18.0.1.1
paltform/os: ubuntu 21.10 (it's not Android client)
The text was updated successfully, but these errors were encountered: