Alvin Lin
1 min readDec 22, 2018

--

Hi there,

socket.on('disconnect', function() {})

is probably what you’re looking for. Like connect, the disconnect message is a built in message sent when a client disconnects. You can put code in the handler to remove the corresponding socket.id from the players object.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Alvin Lin
Alvin Lin

Written by Alvin Lin

I'm a software engineer from New York City with a permanent case of bed hair.

No responses yet

Write a response