SimpleTCP icon indicating copy to clipboard operation
SimpleTCP copied to clipboard

Getting all connected clients

Open Alanjdv opened this issue 7 years ago • 1 comments

I decided to use SimpleTcp for a little game I'm developing, and it works prety well. However, I cannot get all connected clients to my server (reviewing the code it seems they are stored in a private list), so... Am I missing anything? Or is there a reason to make them non accessable? Excuse my english and thanks for your work.

Alanjdv avatar Jun 14 '18 10:06 Alanjdv

The easiest solution would be having a list on your server end that keeps track of that, rather than relying on the tcp listener to reliably keep track of clients.

A tcp client can disconnect after the data has been send. As well as allowing you to secure it using a form of encryption to prevent users from tampering with the data being send.

In my own implementation I loop over a list of clients on the server end on a timer and ping them back to see if they're still alive and remove them if they're not

harleyknd1 avatar Jul 25 '18 08:07 harleyknd1