Skip to main content
Generally tidying up.
Source Link
Zero Piraeus
  • 59.7k
  • 28
  • 158
  • 164

I am asking this because, I want to have some features on my websites, like allow logged in people to chat eachotherwith each other. That is where I need an alive connection to PHP pages. I am also planning on making a browser based game, and an alive connection will still be a must!

AJAX was a rare thing 2 years ago, shined with Facebook. Now pretty much everyone uses it, and it became a standartstandard on web development. Now, the COMET based websites are growing. Youtube, Google+, Facebook, EA's Battlelog and such. I believe I should learn how to use it.

  1. Some languages like Phyton hasPython have special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are: a. Using APE. b. Using Socket.IO c. Node.js Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  3. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 

usleep()a. Using APE.

b. Using Socket.IO

c. Node.js

Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  1. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 

usleep() function basically destroyed my web server on Windows based operating systems. Is it normal to rely on usleep()usleep() on comet applications which runs on windows based osOS? I mean, is there even a way to "sleep" PHP scripts? No matter what I do, CPU load goes to %100 on both WIN and UNIX servers.

-a chat script, where logged in players will be able to chat eachother. -a browser based game. I already use JSON/AJAX and things like that when coding, but to receive opponents steps, I should pull the data, so an alive connection is needed. (Don't imagine advanced games, I am speaking about games like chess at best.)

  • A chat script, where logged in players will be able to chat eachother.
  • A browser based game. I already use JSON/AJAX and things like that when coding, but to receive opponents steps, I should pull the data, so an alive connection is needed. (Don't imagine advanced games, I am speaking about games like chess at best.)

I would appreciate if you can give me a short guidance. After all, I have been getting confused day by day since there are SO MANY random articles on internet. People even call setInterval()setInterval() as COMET, so it is a complete mess.

Thank you, and sorry for the long post.

I am asking this because, I want to have some features on my websites, like allow logged in people to chat eachother. That is where I need an alive connection to PHP pages. I am also planning on making a browser based game, and an alive connection will still be a must!

AJAX was a rare thing 2 years ago, shined with Facebook. Now pretty much everyone uses it, and it became a standart on web development. Now, the COMET based websites are growing. Youtube, Google+, Facebook, EA's Battlelog and such. I believe I should learn how to use it.

  1. Some languages like Phyton has special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are: a. Using APE. b. Using Socket.IO c. Node.js Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  3. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 

usleep() function basically destroyed my web server on Windows based operating systems. Is it normal to rely on usleep() on comet applications which runs on windows based os? I mean, is there even a way to "sleep" PHP scripts? No matter what I do, CPU load goes to %100 on both WIN and UNIX servers.

-a chat script, where logged in players will be able to chat eachother. -a browser based game. I already use JSON/AJAX and things like that when coding, but to receive opponents steps, I should pull the data, so an alive connection is needed. (Don't imagine advanced games, I am speaking about games like chess at best.)

I would appreciate if you can give me a short guidance. After all, I have been getting confused day by day since there are SO MANY random articles on internet. People even call setInterval() as COMET, so it is a complete mess.

Thank you, and sorry for the long post.

I am asking this because, I want to have some features on my websites, like allow logged in people to chat with each other. That is where I need an alive connection to PHP pages. I am also planning on making a browser based game, and an alive connection will still be a must!

AJAX was a rare thing 2 years ago, shined with Facebook. Now pretty much everyone uses it, and it became a standard on web development. Now, the COMET based websites are growing. Youtube, Google+, Facebook, EA's Battlelog and such. I believe I should learn how to use it.

  1. Some languages like Python have special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are:

a. Using APE.

b. Using Socket.IO

c. Node.js

Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  1. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 

usleep() function basically destroyed my web server on Windows based operating systems. Is it normal to rely on usleep() on comet applications which runs on windows based OS? I mean, is there even a way to "sleep" PHP scripts? No matter what I do, CPU load goes to %100 on both WIN and UNIX servers.

  • A chat script, where logged in players will be able to chat eachother.
  • A browser based game. I already use JSON/AJAX and things like that when coding, but to receive opponents steps, I should pull the data, so an alive connection is needed. (Don't imagine advanced games, I am speaking about games like chess at best.)

I would appreciate if you can give me a short guidance. After all, I have been getting confused day by day since there are SO MANY random articles on internet. People even call setInterval() as COMET, so it is a complete mess.

added 7 characters in body
Source Link
Martin.
  • 10.5k
  • 3
  • 45
  • 69
  1. Some languages like Phyton has special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are: a. Using APE. b. Using Socket.IO c. Node.js Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  3. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

    while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load }

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 
  1. Some languages like Phyton has special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are: a. Using APE. b. Using Socket.IO c. Node.js Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  3. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

    while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load }

  1. Some languages like Phyton has special web servers designed for this job. I believe one of them is called Tornado Web Server. Developed and configured to simulate thousands of alive connections. I believe there is no such option in Appserv, but some people told NGINX can handle it with a decent configuration. Is it true? What configurations should be made? Is there any PHP web servers for this job?

  2. Some of the most suggested things are: a. Using APE. b. Using Socket.IO c. Node.js Is there any way we can use them with PHP? Which one is the most promising? Could you give some guidance on them? Is there anything else than these?

  3. I have used a comet chat script. Basically, you kept querying database and output the result with flush() to browser by sleeping it with usleep() in a loop. (This one became hard to understand so I will provide a quick code)

     while(true) { // query database // output the result // flush the browser // sleep for few seconds to lower cpu load } 
added 152 characters in body
Source Link
Aristona
  • 9.5k
  • 10
  • 59
  • 82
  1. Is PHP "really" that weak on this area? Should I give up with PHP and focus on other languages? If so, which language would you suggest?

    Is PHP "really" that weak on this area? Should I give up with PHP and focus on other languages? If so, which language would you suggest? (That language should be promising. For example, there is no much use of AS3 after HTML5 addition, and AS3 is more likely to die soon while JS shines.)

  2. What is WebSync? Can it be used with PHP?

  1. Is PHP "really" that weak on this area? Should I give up with PHP and focus on other languages? If so, which language would you suggest?
  1. Is PHP "really" that weak on this area? Should I give up with PHP and focus on other languages? If so, which language would you suggest? (That language should be promising. For example, there is no much use of AS3 after HTML5 addition, and AS3 is more likely to die soon while JS shines.)

  2. What is WebSync? Can it be used with PHP?

Source Link
Aristona
  • 9.5k
  • 10
  • 59
  • 82
Loading