File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to count the number of client machines connected to server machine in java using socket communic

 
Riyas Hameed
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi All,

Iam working on stand alone application in java using socket communication,
Almost 200 cleint machines will transfer files to server system . how to find the number of client machines is connected with server. please advise me , Iam new to netwroking concept.
please correct me if I am wrong.
Thanks in Advance.
 
chenna kesava.ich
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Riyas Hameed wrote:


Hi All,

Iam working on stand alone application in java using socket communication,
Almost 200 cleint machines will transfer files to server system . how to find the number of client machines is connected with server. please advise me , Iam new to netwroking concept.
please correct me if I am wrong.
Thanks in Advance.


Are you asking for machines connected to server at that instant or total no. of connections after server started ?
 
Riyas Hameed
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chenna kesava.ich wrote:
Riyas Hameed wrote:


Hi All,

Iam working on stand alone application in java using socket communication,
Almost 200 cleint machines will transfer files to server system . how to find the number of client machines is connected with server. please advise me , Iam new to netwroking concept.
please correct me if I am wrong.
Thanks in Advance.


Are you asking for machines connected to server at that instant or total no. of connections after server started ?


Thanks for your response .
for example my client program have installed in 100 machines , all these client machines are connected to server , due to some problem some of the client machines are not connected with server while running , how do you I know what are the client machines not connected with server also I want to count the number of machines connected with server .
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Riyas, please don't quote your own posts. That isn't what the quoting feature is for and it just makes it confusing for everybody else. I've edited your posts to unquote them.

As for your question (or at least one version of it): Use an int variable. When a client connects to your server, increment that variable. When a client disconnects, decrement it.
 
Riyas Hameed
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Riyas, please don't quote your own posts. That isn't what the quoting feature is for and it just makes it confusing for everybody else. I've edited your posts to unquote them. As for your question (or at least one version of it): Use an int variable. When a client connects to your server, increment that variable. When a client disconnects, decrement it.




Thanks Paul, here after it wont happen
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic