Is it possible to know how many clients there are connected on a server? is there a method that does that, maybe in net class? or must I do a counter?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t look like
ServerSockethas a built-in of returning a count. But because you have to manually accept connections by callingaccept(), you can easily increment a counter. The only difficulty (if it is one) is to decrement the counter on disconnect.