lua-users home
lua-l archive

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



> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of dehmel.r@atg-lm.com
> Sent: maandag 3 februari 2014 16:04
> To: Lua mailing list
> Subject: lua-websockets for lua 5.2
> 
> Hi,
> I have installed lua-websockets with copas (luarocks install lua-websockets)
> for lua 5.2 and run into some problems.
> Here is my way to solve this problems:
> 
> 1. I have only lua 5.2 on my Windows 7 and the MinGW compiler.
> 2. luarocks install lua-websockets
> 3. Trying to start a test program with websockets: "lua5.1.dll is missing"

You didn't compile this, and the inary was compiled against another Lua setup on windows. Compile from source, that works (mostly). In this case lpack hasn't been updated to Lua 5.2 yet. And probably neither has web-sockets.

So fix 5.2 compatibility, and send patches/pull requests to the owners...

> -> pack.dll depends on lua5.1.dll
> -> down load the src rock of lpack
> -> trying to compile:
> --> failed because of lpack.c line:254 luaL_reg the header of lua 5.2 has
> this type "luaL_Reg"
> --> now the pack.dll can be recompiled with lua 5.2 and linked to
> --> lua52.dll
> -> trying a websockets test application
> --> failed because of "rol" is nil. Problem is in websockets->tools.lua
> --> line:3 local rol = bit.rol because bit32 (the bit replacement in lua
> 5.2) has changed the name "rol" to "lrotate"
> --> changing line:3 to local rol = bit.lrotate
> -> now the winsocket test application works fine,
> 
> BUT only the test application:
> In my application I have to add a thread to copas. I use this example from
> the copas manual:
> local socket = require("socket")
> local copas = require("copas.timer")
> 
> local host = "127.0.0.1"
> local port = 10000
> 
> local skt = socket.connect(host, port)
> 
> copas.addthread(function()
>   while true do
>      print("receiving...")
>      local resp = copas.receive(skt, 6)
>      print("received:", resp or "nil")
>      if resp and resp:sub(1,4) == "quit" then
>         skt:close()
>         break
>      end
>   end
> end)
> 
> copas.loop()
> 
> --> this example misses one important thing:
> skt:settimeout(0)

Yes, that is a known issue (at least to me). I think the copas documentation could use an additional note on this.

> without this addthread() blocks during the (internal) first call of the
> thread function before the copas loop can be started.
> 
> Now every thing looks fine!
> 
> I'm new in this mailing list - is this the right place for this information?

All the authors are on this list, so probably yes as for a general question, but for their specific issues I think their repo's are best (though lhf doesn't have one iirc).

> 
> Ruediger
> 
> ______________________________________________________________________
> 
> atg Luther & Maelzer GmbH
> Sitz / Company Seat : 97877 Wertheim / Germany Strasse / Street : Zum Schlag
> 3 Amtsgericht / Local Court : Mannheim HRB 705702 Geschaeftsfuehrer /
> Managing Director : David G. Tacelli USt.-Id. Nr. / VAT ID No. : DE 814 906
> 312 St.-Nr. / TIN No. : 80088 / 23872 Finanzamt / Revenue Office :
> Tauberbischofsheim
> 
> ______________________________________________________________________
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese E-Mail.
> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist
> nicht gestattet.
> This e-mail may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this e-mail in
> error) please notify the sender immediately and destroy this e-mail.
> Any unauthorised copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.