Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.