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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -