length
bytes of data from any senderOn error, returns an empty string and sets error
appropriately.
# Receive `length` bytes of data from any sender
#
# On error, returns an empty string and sets `error` appropriately.
fun recv(length: Int): String
do
var buf = new CString(length)
var len = native.recvfrom(buf, length, 0, new NativeSocketAddrIn.nul)
if len == -1 then
error = new IOError.from_errno
return ""
end
return buf.to_s_unsafe(len, copy=false)
end
lib/socket/socket.nit:382,2--394,4