This is a full-featured port of LuaSocket for GMod. I've tried a simple socket thing, which worked out just fine.
Neico posted:Installation instructions:spbogie posted:
Extract that archive in garrysmod/lua/includes/modules.
You will need the VS2008 runtime libs, or else you'll get a strange error while loading: http://www.microsoft.com/downloads/d...displaylang=en
Don't ask any questions unless you've installed that (and rebooted)
Usage:
Just like LuaSocket, see this for a reference: http://www.tecgraf.puc-rio.br/~diego...reference.html
Don't forget forget to use non-blocking sockets (set timeout to 0) or else GMod freezes while waiting for data!
Source code:
It's a VS 2008 project, should work in the Express version.
Thanks to:
Sechs - helped me with testing in #luahelp
Jinto - provided the Lua import library
Small example:
require("socket") local s = socket.connect("www.google.com", 80) s:send("GET / HTTP/1.1\n") s:send("Host: www.google.com\n") s:send("User-Agent: GMod10\n") s:send("Connection: Close\n") s:send("\n") local line = s:receive('*line') print(line) s:close()
I don't know if that is correct but it should give you an idea about how it's used. You don't even have to use it manually, there are some helper modules too (http, smtp, ftp), but they don't seem to work. they probably would with some modification.

Register
Events
Popular
More
Post #1


Useful x 2
Lua King x 2
Optimistic x 1


Disagree x 1

Agree x 1

Funny x 1




Dumb x 1