Well, I don't know how you will pass the actual lua_state through the socket. Perhaps you can extract the information contained in lua_state and then pass the extracted information through the socket?
std::string name(lua_tostring(L,1)); int age = lua_tonumber(L,2);
And if you have a response from the socket that you want to forward to lua, just do something like
//get response from socket and push response to lua lua_pushnumber(L, response); return 1; //indicate how arguments you are returning.
Hope this helps. Good luck
source share