net module issues

classic Classic list List threaded Threaded
3 messages Options
Campbell Letts Campbell Letts
Reply | Threaded
Open this post in threaded view
|

net module issues

Hi All,
I'm having trouble with the net module on an lm3s8962 board. I can only sporadically connect the board to the computer. Once connected the functionality works as expected.

Issue 1:
  The net.connect() function repeatedly returns an error code of -1. What does this mean? It is not one of the listed error codes.

Issue 2:
  The net.socket() function is called to find and reserve a free socket so that you can use it in following calls. Calling it repeatedly returns incrementing socket numbers as I would have expected. After 0-3 sockets it starts returning -1 presumably indicating that there are no more available sockets to be assigned. I had expected a call to net.close(socket) to close the socket and free it so that I could then reassign it with another call to net.socket(). Is there a reason this doesn't appear to be the case?

I understand that the net module has recently been undergoing changes. Are those likely to have affected my work? I've pulled from the master in the last couple of days.

Cheers,
Campbell

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|

Re: net module issues

On 20 December 2011 23:51, Campbell Letts <[hidden email]> wrote:
> I understand that the net module has recently been undergoing changes. Are
> those likely to have affected my work? I've pulled from the master in the
> last couple of days.

I gather (and am hoping!) that Bogdan is working on an alternate IP
stack for eLua. What I would do is not care whether we have the
current net.* or something else, bu implement Lua sockets, in Lua, on
whatever IP mechanism we happen to have available at the time.

On a similar vein, a user recently asked me how he could get a
direcory listing of /mmc and I had to say - er um no you can't
AsFarAsIKnow for which the answer would we to implement Lua File
System, again in Lua, on the primtives that we already have

Bla bla luaposix the same kind of argument

I think that would make eLua more Lua-like as well as enabing us to
import a sack of Lua libraries  out there that use LFS and lusposix

whaddya think?

  M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: net module issues



On Tue, Dec 20, 2011 at 7:45 PM, Martin Guy <[hidden email]> wrote:
> On 20 December 2011 23:51, Campbell Letts <[hidden email]> wrote:
>> I understand that the net module has recently been undergoing changes. Are
>> those likely to have affected my work? I've pulled from the master in the
>> last couple of days.
>
> I gather (and am hoping!) that Bogdan is working on an alternate IP
> stack for eLua. What I would do is not care whether we have the
> current net.* or something else, bu implement Lua sockets, in Lua, on
> whatever IP mechanism we happen to have available at the time.

The current IP stack hasn't had a great deal of change recently, but does have some outstanding issues that should be improved upon in an upcoming, yet to be merged, branch that Bogdan has been working on, the fruits of which I think are mostly here:
https://github.com/elua/elua/tree/newstack
(I can't speak to the state of that on LM3S at the moment, perhaps Bogdan can chime in)

As for LuaSockets, it would be nice to have either a compatibility layer or just an interface that behaved like the LuaSockets API.  I'm not sure we could easily include the support modules, but perhaps at least the basic API might be straightforward?

>
> On a similar vein, a user recently asked me how he could get a
> direcory listing of /mmc and I had to say - er um no you can't
> AsFarAsIKnow for which the answer would we to implement Lua File
> System, again in Lua, on the primtives that we already have

Yeah, there's no way to get directory listings aside from using the raw C api.  I haven't looked at the innards of LFS or luaposix, but I'm sure we could implement as much of the API as makes sense for eLua, and then support a pretty wide cross section of Lua scripts or at least an API people are familiar with.  It's certainly fairly fundamental and useful functionality.

I wonder how much code or ram overhead we might be talking about to implement these.

>
> Bla bla luaposix the same kind of argument
>
> I think that would make eLua more Lua-like as well as enabing us to
> import a sack of Lua libraries  out there that use LFS and lusposix

Sounds good.  One thing is though that one will still need a reasonably beefy mcu ram-wise to run a wide cross section of desktop code out of the box. However, it does provide a convenient way to test code on desktop lua before running on embedded targets.

>
> whaddya think?
>
>  M
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev