OpenMoko light web server

Matthew S. Hamrick mhamrick at cryptonomicon.net
Tue Apr 24 22:38:37 CEST 2007


BTW... I tried this out, it seems to work fine.

It still feels "wrong" to intentionally leave an HTTP connection open  
like this, but it seems to work okay when I test it.

I'm building some new javascript for the jowles interface that uses  
async requests, along with an XML service interface and will publish  
the code to the hbmobile project ( http://code.google.com/p/ 
hbmobile/ ) "any day now." I'm starting to document this stuff at the  
Jowles wiki page.

Tim... thanks for the idea of using async requests, it should have  
been obvious, but it wasn't, so thanks for pointing it out.


On Apr 16, 2007, at 9:36 PM, Tim Newsom wrote:

>
> On Mon, 16 Apr 2007 13:58, Matthew S. Hamrick wrote:
>> Okay.. a few points:
>>
> <snip>
>> Q. javascript? on a phone? Isn't that going to suck down the power?
>>
>> A. in a word, yes. But I think the main problem will not be the  
>> added overhead of using javascript, it's going to be the frequent  
>> request / response. In the old days when we bundled ORBs with  
>> browsers, we could execute java (and presumably have a javascript  
>> interface) that would receive asynchronous messages from the  
>> server. Why is this important? Because the phone (on the other  
>> side of the http interface) is going to ring or receive an sms  
>> message or the signal is going to go up or down. And these are  
>> things that occur outside the context of a client request. So, if  
>> you want to see if the phone just rang, you have to keep pinging  
>> the web server every second or so, and if it responds with "I'm  
>> ringing," you fire off the javascript that draws the "I'm ringing"  
>> icon on the interface. All in all this is pretty substandard.
>>
>
> Ok.. Well this is probably somewhat browser specific, but in the  
> XMLHttpRequest methods there is a synchronous or asynchronous  
> flag.  Synchronously will behave in the normal request response  
> method and wait for a return before continuing to execute... Async  
> will allow the code to continue executing and then fire the  
> response once it sees it.  I don't know if there are timeouts or  
> not and I have not played around with it much, but it seems like  
> you could build several request objects... One might be dedicated  
> to the ringing function.. Then place a timer on it and if there is  
> no response by the timeout you could reset.  All the request would  
> do is ask if the phone rang and wait.. Then your cgi code could sit  
> for the period of the timeout waiting for either a request (to  
> cover the situation of the phone ringing between requests) or  
> responding when the phone rings...
>
> This should be more like the subscription model where you ask to be  
> notified and at any point it could happen.  But, like I said, it  
> may be browser specific. /shrug
> Just something to look into maybe.
> --Tim
>
> _______________________________________________
> OpenMoko community mailing list
> community at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community





More information about the community mailing list