Jump to content

How to get informed Clients Disconnected from the Server


llcoollasa

Recommended Posts

How to get informed Clients Disconnected from the Server

 

HI everyone?

1. is there a way to determine how many clients(web browsers) connected to the server??

 

2. is there a way how to send a message to the client from the server. Not client to server...

 

Example:

Assume there is a web site that showing online score of a game.

 

How was it done?

 

is there a client script(js) that request score from the sever or server send score to the client.

 

i like to learn.....

 

This may be of some use to you for Q1 (assuming a *nix system):

 

http://www.mydigitallife.info/2007/12/13/how-to-find-and-check-number-of-connections-to-a-server/

 

You should be able to run that through the system function:

 

system("netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1");

 

You may not get a truly accurate result running through PHP though as you're not root user.

 

Think you need to give more details for Q2, what kind of "message" do you mean?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.