Hi Pete,
Tried to use latest luasocket library but without success... I'm bit puzzled.
That's what I did:
1. Created lua dir in FSX modules directory.
2. Layout as follows (following luasocket installation manual):
Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua
27/06/2008 11:18 8,469 ltn12.lua
01/06/2016 23:10 <DIR> mime
01/06/2016 23:14 2,521 mime.lua
01/06/2016 23:18 <DIR> socket3
01/06/2016 23:15 5,012 socket3.lua
Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua\mime
15/10/2007 18:08 12,800 core.dll
Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua\socket3
15/10/2007 18:08 29,184 core.dll
26/05/2016 11:20 9,243 ftp.lua
26/05/2016 11:20 3,698 headers.lua
26/05/2016 11:20 12,330 http.lua
26/05/2016 11:20 8,074 smtp.lua
26/05/2016 11:20 3,612 tp.lua
26/05/2016 11:20 11,036 url.lua
3. As you see modified lib name to socket3 and relevant dir/files.
4. It also make sense to modify a line in socket3.lua :
local socket = require("socket3.core")
This unfortunately causes error message in debug window:
4308389 *** LUA Error: error loading module 'socket3.core' from file 'C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\modules\lua\socket3\core.dll':
The specified module could not be found.
Although the file core.dll in fact exits there (taken from lua 5.1.4 clibs installation folder). Perhaps not matching exactly LUA version built into FSUIPC?
5. If I leave socket3.lua unmodified ( local socket = require("socket.core") ), then all seems to be running but my impression is that build in luasocket is run and my test script:
socket = require("socket3")
print(socket._VERSION)
returns: 5177284 LUA.0: LuaSocket 2.0.2
Unfortunately I'm not software engineer and my experience here is very limited.
Any ideas what I'm doing wrong?
BTW: Here is a bit from NEW file of recent luasocket package:
What's New
Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility.
* Added: Compatible with Lua 5.2
- Note that unless you define LUA_COMPAT_MODULE, package
tables will not be exported as globals!
* Added: IPv6 support;
- Socket.connect and socket.bind support IPv6 addresses;
- Getpeername and getsockname support IPv6 addresses, and
return the socket family as a third value;
- URL module updated to support IPv6 host names;
- New socket.tcp6 and socket.udp6 functions;
- New socket.dns.getaddrinfo and socket.dns.getnameinfo functions;
* Added: getoption method;
* Fixed: url.unescape was returning additional values;
* Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could
mistaking their own stack slots for functions arguments;
* Fixed: Receiving zero-length datagram is now possible;
* Improved: Hidden all internal library symbols;
* Improved: Better error messages;
* Improved: Better documentation of socket options.
* Fixed: manual sample of HTTP authentication now uses correct
"authorization" header (Alexandre Ittner);
* Fixed: failure on bind() was destroying the socket (Sam Roberts);
* Fixed: receive() returns immediatelly if prefix can satisfy
bytes requested (M Joonas Pihlaja);
* Fixed: multicast didn't work on Windows, or anywhere
....
so obviously I'm eager to get this lib working ... but perhaps there are unavoidable conflicts with build-in luasocket library?
Best regards