Skip to content

Socket.to is not a function #4519

Answered by pepper28
pepper28 asked this question in Q&A
Nov 12, 2022 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

I've tried the following "socket.to(sessionID).emit(txId);", "socket.emit(txId);", and "server.to(sessionID).emit(txId);". My client is a java machine and although I'm sending userInfo and points successfully using, "socketWriter = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); " to Nodejs socket.io. I can only receive the txId if the method I'm using is socket.to(sessionID).emit(txId), but this crashes Nodejs. If I use socket.emit(txId) Java client running " socketReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));" never gets call or txId data.

My environment for both the Java client and the NodeJS Server is Ubuntu Linux version 18.04.

Her…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@darrachequesne
Comment options

@pepper28
Comment options

Answer selected by darrachequesne
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants