lua-users home
lua-l archive

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


> 1) It would be great if your build process could support being built
> directly into the interpreter. My system doesn't have dynamic linking,
> so I had to hack your Makefiles (needed in any way, because the
> compiler flags have to be <just so> to get it to actually run on the
> target system).

You mean automatically? This is tough, isn't it? You have to
change your interpreter, and LuaSocket doesn't have access
to it. If you are building your own interpreter, on the
otherh and, it is simple to link LuaSocket to it.

Just add the obj files to your makefile, then make sure you
populate package.preload with luaopen_socket_core and

It is not about being tough or not. It's a simple request that at
least have an option to be friendly to those who are building your
code directly into the interpreter. It shouldn't be a large change to
the makefile.

Let's get something out of the way, new guy. I am pretty
friendly. :)

The changes you are proposing simply build a static library.
Yes, I can do that, and perhaps I should have done that

But your request was to build it directly to the
interpreter, that's what I said was tough. Even if the
makefile managed to link that static library to the Lua
interpreter, it would not be enough. You have to, as I said,
modify the interpreter to setup the package.preload table.

So, the user already has to modify lua.c and the Lua
makefiles. This kind of user is already pretty
knowledgeable. Add to that the small number of such users,
and you can see why it was left out.

> 3) It doesn't have ping functionality, though it wouldn't be hard to
> do that, but why not? Pings that timeout are basically the only way I
> can think of to check if the network is available or not.

I'd be happy to consider a patch for that. I believe it
would require an API and some C code.

Here's some C code for that. It's derived from BusyBox ping (socket
timeout and not lingering added). The rest I found were quite bloated.
I'm sure you can work from it.

Perhaps I should add support for raw sockets?  I already
distribute code that supports local sockets.  Shouldn't be
hard to do that for raw sockets.  Perhaps somebody else
already did it.  Could be useful for other stuff.

> I implemented my own (basic!) HTTP client instead. It fetches from a
> URL and returns the response minus headers. Here's the implementation
> (sans libhttpd which is a socket object built into the interpreter).

If you are interested in the lowest possible number of lines
of code, I would suggest using popen and wget...

It's not the lowest number of lines. I'm building for a embedded
system. Your library alone is bigger than my entire application
(including the functionality that I wanted from your library).

Is that too hard to understand?

I have the impression you are trying to pick up a fight?
Sorry. I wasn't being sarcastic.