Chrome, lchttpd and a possible Livecode socket bug?

David Bovill david at viral.academy
Wed Jul 15 06:08:50 EDT 2015


First off where do we report bugs now? Bugzilla or Github issues?

@andre - dropbox is no longer public. I'd love to check out your old server
stacks.
@todd - I'm hacking away pretty radically at your minimal server
@monte - yes it would be good to use github for version control. I'll take
a look at lcVCS, and also modify lchttpd to use script only libraries for
behaviors and libraries.

Update on  - it seems that the background problem is an issue with hanging
ports - that is ports that the modified lchttpd is not closing. So I am
trying to get my head back around http/connections/sockets and so forth.

It seems that (looking at the openssockets during a request) that a single
GET request results in 2 connections and 3 entries in the opensockets:

8082
> 127.0.0.1:62291
> 127.0.0.1:62293


However depending on which client is making the http calls we get a
different number of "newconnection" messages - the issue seems to be with
Chrome - anyone have an idea why???


*Firefox, Safari and Livecode*
With Safari, Firefox or Livecode sending an http GET request to
localhost:8082 (ie in Livecode - put url "http://localhost:8082/somePath")
we only trigger *a single newConnection message*.

You can see from the following logs created when Chrome connects to the
Livecode server - http://pastebin.com/x2cNKdK4

Similarly as the Livecode server includes the line:

   *write* it to socket theSocket with message "closeConnection"


We also then only get *a single closeConnection message *(send as a param
while writing back to the client), which we handle to close the socket -
everything is good.


*Chrome*
You can see from the following logs created when Chrome connects to the
Livecode server - http://pastebin.com/WfqzRwrW

When Chrome is used to connect to the Livecode server two newConnect
messages are send, and as a result the second connection is not closed -
either by the our LiveCode script (the closeConnection message is only
triggered once).

The Chrome server then hangs waiting for further data and keeps the second
connection open. Manually closing this connection in Livecode fixes the
problem, and allows the browser to complete it's request.

*A fix?*
I'm going to take a look at how to associate this open socket with Chrome,
and close it in LiveCode in a script. The problem is that a web page often
fires of several requests at once, or even another client can hit the
server, and so just closing all connections results in other client
connections getting broken - any ideas?




On 14 July 2015 at 23:38, David Bovill <david at viral.academy> wrote:

> OK - I've been experimenting most of the day with running Livecode as a
> server daemon (not as a cgi). It's a bit problematic and I am trying to
> track down bugs.
>
> One issue is that the server does not seem to respond well when it is in
> the background - so when I move over to a browser and ping the server it
> freezes until I bring the server-stack to the front.
>
> Any thoughts? Did this happen with earlier versions?
>
>
> On 6 November 2014 at 21:37, Andre Garzia <andre at andregarzia.com> wrote:
>
>> Friends,
>>
>> I haven't touched this in ages. I have a couple gigs on a folder called
>> "RunRev Source" here and there was a RevHTTP folder there. There is a lot
>> of non-working half baked goodies in that folder but I think that the main
>> httpd.rev file should work ok.
>>
>> https://www.dropbox.com/s/0636wl30z4btg1u/RevHTTP.zip?dl=0
>>
>> Have fun and send me feedback.
>>
>> Also, a disclaimer: You should not host any public facing thing using this
>> server. Its a research, hobbie, toy thing. It can't answer more than one
>> request at a time and this will kill things for public access. Even so,
>> people have used this or variations of this source in production for their
>> internal stuff and were happy with it.
>>
>> My advise: Go with nginx + livecodeserver.
>>
>> Cheers
>>
>>
>> On Tue, Nov 4, 2014 at 8:07 PM, Monte Goulding <
>> monte at sweattechnologies.com>
>> wrote:
>>
>> >
>> > On 5 Nov 2014, at 7:02 am, Todd Geist <todd at geistinteractive.com>
>> wrote:
>> >
>> > > I put the code on github
>> > >
>> > > https://github.com/toddgeist/lchttpd
>> >
>> > Yay for another FOSS lcVCS project on GitHub! If we keep this up the
>> Ohloh
>> > folks might eventually get around to merging in my pull request adding
>> > livecode as a recognised language ;-)
>> >
>> > Cheers
>> >
>> > Monte
>> >
>> > --
>> > M E R Goulding
>> > Software development services
>> > Bespoke application development for vertical markets
>> >
>> > mergExt - There's an external for that!
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>>
>>
>>
>> --
>> http://www.andregarzia.com -- All We Do Is Code.
>> http://fon.nu -- minimalist url shortening service.
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list