After Reading this, downloading the x64 binary of socket and replacing them in the lua "clibs" directory, with no positive results, I would like some help on resolving the following error that i'm receiving from eclipse:
Exception in thread "main" com.naef.jnlua.LuaRuntimeException: error loading module 'socket.core' from file 'C:\Program Files (x86)\Lua\5.1\clibs\socket\core.dll':
%1 is not a valid Win32 application.
at com.naef.jnlua.LuaState.lua_pcall(Native Method)
at com.naef.jnlua.LuaState.call(LuaState.java:555)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.run(JNLua51Launcher.java:128)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.main(JNLua51Launcher.java:143)
This is my enviorioment:
- Windows 10 x64;
- Lua 5.3;
- LUA_PATH is defined corretly;
- LUA_CPATH is defined corretly;
Here is my code:
-- Requires
local socket = require 'socket'
-- Settings
host = "localhost"
port = 8384;
-- Program Start
print("Program Start")
-- Functions
local function main()
client = socket.connect(host, port)
client:send("test!")
while true do
s, status, partial = client:receive(1024)
print(s or partial)
if status == "closed" then
break
end
end
client:close()
end
main()