bartbes / love-misc-libs

Just some random libs I have lying around, now with version control!
http://docs.bartbes.com
110 stars 28 forks source link

LUBE-testing: tcpServer:receive fails to get the data properly #4

Closed Boolsheet closed 13 years ago

Boolsheet commented 13 years ago

The tcpServer:receive function will have a hard time getting any data as non-blocking sockets most likley return with the timeout error.

https://github.com/bartbes/love-misc-libs/blob/LUBE-testing/LUBE/LUBE.lua#L384

The luasocket reference says that the receive function returns the following things: dataAsRequestedByPattern, errorMsg, partialData

Where partialData can be an empty string if nothing is in the buffer or however it gets handled.

On top of that LUBE passes no pattern and luasocket defaults to "*l" which drops all CR and LF characters.