I'm while using comet lengthy-polling technique with apache, php, jquery.
I have got a fundamental comet update running and delay pills work great. I am now trying to construct a far more complex comet script, and that i want an easy method to debug.
My comet scripts use $.ajax() having a lengthy timeout, and also the server side just sleeps until it either runs as much as the timeout or comes with an event to transmit towards the client. The comet demands visit a different subdomain compared to primary ajax demands.
For normal pages I edit and test on the linux laptop. I have got apache, mysql, and php having a test database and mirror picture of the website. I'm able to edit, save, and find out the alterations without any upload step. For that comet stuff I have been needing to upload to some server to check. This involves me to setup a couple of fake servers, but mostly it takes me to upload transformed files for every test. I have got a mostly automatic upload script, but it is still not fast enough.
The issue testing in your area may be the lengthy timeout. The browser will not open another link with exactly the same server as the comet request continues to be open. I do not possess a subdomain in your area and so i have the demands visiting the same server so that they essentially block one another.
I have attempted numerous things to make this happen and none do it. I attempted first to alter my browser setting for quantity of synchronised connections. This did not operate in opera on linux, and that i did not find anything about altering this limit on other browsers.
I attempted setting my hosts file to provide me two names that map to my ip. I Quickly attempted setting up VirtualHost conf directives in apache, but that did not work. I believe because apache is searching for a real dns server to inform it the hostname, not only my /etc/hosts file. Maybe I'm able to operate a local dns server to fool apache into thinking my box has two names, but that simply appears just like a real lengthy way for this problem.
So, does anybody know of methods to make this happen on a single ip/host?
I am a new comer to the comet factor, so perhaps I have got the wrong impression about something. Maybe this is not even possible. In either case, you're ready to just request if this sounds like already a solved problem.
It should be easy to use /etc/hosts to fool Apache. It certainly works on Ubuntu Sturdy with Apache 2.2.
Attempt to give different hostname for you local address. Simply give a line such as this to /etc/hosts:
127.0.0.1 a.example.com b.example.com c.example.com d.example.com
(Note: make use of a tab after IP)
Validate this having a ping
In your soul apache configuration, you can utilize a wildcard alias plus a named virtual host:
<VirtualHost *:80> ServerName example.com ServerAlias *.example.com ## snip ## <VirtualHost>
Rather than using example.com, you might like to use something that's beneath your control. I personally use local subdomain in our company's domain (i.e. something.local.molindo.at).
You can now use different subdomains for the test, each using its own limitation on concurrent connections.
You may want to restart your browser to obtain this working.
I've made such like and my hosting gives my max queries limit arrived at which really shouldn't happen. However I read when my php code is within infinite loop.. ie the sleep mode the hosting picks up it and makes db connection user they can be using more queries than permitted. That's alot to presume but I've discovered a strategy to by using same speculations.