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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi. i wish to ask for ideas on my issue. socket.io 4.7.4
I noticed that if i close the laptop, my browser has socket.io getting disconected and then reconnecting after i open the laptop back.
I also have verified in the server that if i send an event from the client to the server, it works ok.
The problem is when the server emits an event back to the client, the events in the client browser are not received. nothing happens.
This is how my SocketService class sample looks like in Angular
`
@Injectable({
providedIn: 'root'
})
export class SocketService {
private socket: Socket;
code: string | null = null;
constructor(private translateService: TranslateService) {
this.socket = io(environment.api);
}
}
`
Some client code emits a nevent called send_question and the server receives it then emits QUESTION_NEW event via
io.to(some_code).emit(SocketEvent.QUESTION_NEW)
But the client browser never receives it. This happens when the client gets disconnected and reconnects again.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions