llcoollasa Posted January 20, 2010 Share Posted January 20, 2010 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..... Quote Link to comment https://forums.phpfreaks.com/topic/189135-how-to-get-informed-clients-disconnected-from-the-server/ Share on other sites More sharing options...
Adam Posted January 20, 2010 Share Posted January 20, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/189135-how-to-get-informed-clients-disconnected-from-the-server/#findComment-998548 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.