javascript - how to do time over in games per socket in node js -


i develop poker game using nodejs in server , html5 in client.

all core logic in server , not in client. because client can edit javascript , change logic of game benefit.

i want make timeover function client. example, if doesnt play in 30 seconds, default action(check/fold).

my question how it? cant in javascript because client can edit it. , if i'll in server, isn't block server? thought of openning new thread each socket, , timeout function there, it'll not efficient, if got 10k sockets?

you can set timeout each socket using socket.settimeout. if timeout due inactivity reached socket closed.

maybe you.

read more here


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -