https://github.com/treeform/ws/blob/master/src/ws.nim#L393
"For buffered sockets this function will attempt to read all the requested data. It will read this data in BufferSize chunks."
https://nim-lang.org/docs/asyncnet.html#recv%2CAsyncSocket%2Cint
But it looks like the Nim docs are wrong and there is a loop to read everything:
https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncnet.nim#L412-L419