score:0

Accepted answer

after debugging for a while , i managed to solve the issue,hope this could help other people who struggle at this.

so i accidentally connect to socket twice .

socket.current = await io(process.env.react_app_socket_port)   

base on my test i think it will only connect once and after that even you can successfully passed your message, the socketid will be fixed on the orginally one , but the server will contain your last socketid.

that's why i failed to use io.to(socketid), and because i left the other connect command on other function , so i think no one can answer this question. thanks anyway!


Related Query

More Query from same tag