Closed obskyr closed 7 years ago
Thanks for the PR! Though, technically it's luasocket (and lua-enet?) that converts it to a number ;).
You mentioned adding tonumber in both places, yet I only see one added tonumber, did you forget to commit the other one (presumably in server:listen
)?
I'm a bit tired, as it turns out - I'd fixed it on my end but not in the PR. Whoops. Fixed it now though!
The library could honestly do with 5 tons more documentation, too, hahah, but I suppose that's for another time.
As it turns out, grease (and, by extension, LUBE) supports providing the port argument for
server:listen
as a string. However, if you provide the port as a string forclient:connect
, it fails silently! It just simply never receives any data, due to a failing==
comparison. I spent literal hours chasing this one down...This pull request calls
tonumber
on the port arguments in both places, for consistency. It also preserves backwards compatibility by doing so.