lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Oct 3, 2010, at 8:26 PM, Norbert Kiesel wrote:

> First of all thanks for your help.
> I removed the "close" from that line (and also the TE in another
> attempt), but that does not make a difference.  I even ran it under gdb
> and put breakpoints on meth_close and meth_shutdown (the C functions
> implementing socket:close() and socket:shutdown(), but they are not hit
> and still getfd() returns -1 after the request.

The thing is... LuaSocket http module doesn't support persistent connection by default... so you will have to tweak it a bit...

Now... from an HTTP point of view... you need the client side request to be HTTP/1.1 or use connection = keep-alive for earlier version. 

http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html

And have the HTTP server honor such persistent request... which the server could choose not to.

The easiest way to check what's going on would be to record what HTTP request header are emitted and what response header are returned.