-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
The client is connected fine and can send and receive events, but some times the server doesn't recieve any event and the client is still connected.
The way to reproduce it:
Start and stop the client a few times, until it stops receiveing the pong
message.
client:
const socket = io("http://localhost:8080");
socket.on("pong", ({ datetime }) => {
console.log(`Response time (${(Date.now() - datetime)}ms)`)
});
socket.on("connect", () => {
console.log(`Connected! ${socket.id}`);
setInterval(() => {
socket.emit('ping', { datetime: Date.now() });
}, 1000);
});
socket.connect();
server:
const io = new Server();
io.on("connection", (socket) => {
console.log(`socket ${socket.id} connected`);
socket.on('ping', (data) => {
console.log(`[${socket.id}]: ping!`)
socket.emit('pong', data)
});
});
await serve(io.handler(), {
port: 8080,
});
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working