Jump to content
The simFlight Network Forums

Recommended Posts

Posted
7 minutes ago, Pete Dowson said:

So those binary files we built into the 32-bit version of FSUIPC weren't needed, and probably weren't even used?

I would guess so, assuming that the same code snippet exists in your 32-bit version.

Posted

I've started doing tests on this solution, and i'm afraid I am running into problems. There are missing functions, like "socket.bind". This is with your second linked package above and also with the full package downloaded from your second link.

I think the "core" being linked to in FSUIPC is only partial. The missing 32-bit binaries presumably supply the rest. Your solution appears to work provided you only use some as-yet undeteremined subset of the expected functions.

So, I think I will leave things as they are for now. Thank you very much anyway!

Pete

 

Posted
1 hour ago, Pete Dowson said:

I think the "core" being linked to in FSUIPC is only partial. The missing 32-bit binaries presumably supply the rest.

Were you looking for the bind function inside the table exported by socket.core? The bind function is in socket.lua. By the way, some parts in the packages that I uploaded are definitely not compatible with the 2.0.2 binaries, so you should be using the 2.0.2 lua files.

As far as I can tell, everything is there.

Posted
3 hours ago, adrem said:

Were you looking for the bind function inside the table exported by socket.core? The bind function is in socket.lua.

I was trying to test with the socket examples we provide in the Lua examples ZIP. I edited the first part of testsrvr, this bit:

-- This supports the "testclnt" Plug-In to test the facilities

-- The SOCKET module is built into FSUIPC, but is not active until "required"
socket = require("socket");

to match your code. So now the code to the failure on bind is:

-- This supports the "testclnt" Plug-In to test the facilities

package.path = ""
package.cpath = ""

-- The SOCKET module is built into FSUIPC, but is not active until "required"
socket = require("socket.core");

-- Change the host name to the name of the PC running this Server
-- The "localhost" name only serves local clients
host = "localhost";

-- The port must match the port selected in the client and not clash with others.
port = "8384";

server = assert(socket.bind(host, port));

So it is looking in whatever socket.core contaiins.  Should I revert to socket = require("socket") as before? Why do you set those two paths to ""?  I thought your code was part of the solution.

3 hours ago, adrem said:

By the way, some parts in the packages that I uploaded are definitely not compatible with the 2.0.2 binaries, so you should be using the 2.0.2 lua files.

As far as I can tell, everything is there.

Too much, I think. Not sure what the difference is between the vc6 and vc8 ZIPs are, but I don't need lua5.1.exe ot lua5.1.dll.

Do all the others go into a Lua subfolder, like yours? There is a Lua folder within the ZIP, containing Socket.I'll try again with the contents of that folder in the FSUIPC installation Lua subfolder instead (I do wish I understood all this)

...

Okay! That works! 😄  But only if I revert the Lua plugin code to what it was originally. i.e leave the paths alone and using require("socket").

I tried stripping down what was installed in the Lua subfolder, and all it seems to need is 

ltn12.lua
mime.lua
socket.lua

I now think that the three binary files included in the 32-bit versions of FSUIPC are just these three modules compiled with a 32-bit version of the Lua compiler., so it might be worthwhile looking for a 64-bit version.  If I can do that then I can make 64-bit FSUIPC the same as far as LuaSockets are concerned as FSUIPC4. The trouble is that the Lua code in FSUIPC is based on the 5.1 version of Lua and i think the problem we had was that no 64-bit compiler was available.

Of course, the socket subfolder does contain ftp.lua, http.lua, smtp.lu, tp.lua and url.lua, but those were needed for FSUIPC4 too if you use those protocols.

For now I'll just change the instructions to provide the new LuaSockets link and list those files to be used from it and where they go.

Pete

 

Posted
3 hours ago, Pete Dowson said:

Why do you set those two paths to ""? 

That was just to show you that socket.core and mime.core were being loaded somehow even with empty module search paths, so not at all intended to be used during normal operation - sorry for the confusion 😄 

3 hours ago, Pete Dowson said:

If I can do that then I can make 64-bit FSUIPC the same as far as LuaSockets are concerned as FSUIPC4. The trouble is that the Lua code in FSUIPC is based on the 5.1 version of Lua and i think the problem we had was that no 64-bit compiler was available.

I don't really understand why you'd want to change anything. 64-bit FSUIPC already includes socket.core and mime.core which are the only binary components of luasocket. For the rest, the user can just download this archive and unzip the lua folder that contains just the lua files into the fsuipc directory to have the complete package: http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2-lua-5.1.2-Win32-vc6.zip. No further steps are required to make it work. As far as I understand, in your 32-bit version, ltn12.lua, mime.lua and socket.lua are also part of the binaries, but that's unnecessary.

By the way, I don't see any changes in the documentation - Lua Plug-ins.pdf is exactly the same.

Posted
4 hours ago, adrem said:

I don't really understand why you'd want to change anything. 64-bit FSUIPC already includes socket.core and mime.core which are the only binary components of luasocket.

I know. I thought I explained, sorry. I thought the binary parts we included in FSUIPC4 ere those COREs, but they're not -- they are simply compiled versions of those 3 Lua's I'm now asking folks to install in the Lua folder.

The point was that in FSUIPC4, for many purposes there was no need to install anything else whatsoever.

4 hours ago, adrem said:

By the way, I don't see any changes in the documentation - Lua Plug-ins.pdf is exactly the same.

Ooops! You are right. The updated PDF didn't make it into the ZIP! Duh!

Fixing it now.

Blame old age, I'm feeling more doddery by the day. That's why I'm retured, really. 😉

Thanks,
Pete

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.