Closed PabloMK7 closed 8 years ago
You don't even wait between sent data and receive function. It's normal that your code results in an empty string.
How much should I wait then.
It depends on server quality, connection quality, etc...
Normally, a loop should be used, for example: https://github.com/Rinnegatamante/CHMM2/blob/master/source/index.lua#L1170-L1228
Yes, I figured it out, thanks :D. I tried now to connect to an https server, but using ssl returns couldn't stablish ssl connection, and setting it to false crashes.
nvm
I'll post a Function in lpp3ds thread, so people can use it, thanks!
Tried to request a http file with sockets. function testsocket() Socket.init() checksckt = Socket.connect("ctgp.dshack.org", 80, false) -- (Also tried with the ip 133.130.123.204, still doesn't work) Socket.send(checksckt, "GET /check.txt HTTP/1.0\r\n\r\n") checkscktdata = Socket.receive(checksckt, 1024) Socket.term() end Printing checkscktdata returns: " " (nothing)