Capy-Bearer Documentation

socket_read

host call

Capy

function socket_read(handle : u64, max_length : s32 = 131072, timeout : s32 = 1) string

Description

Use socket_read to read data from a socket. It can return an empty string when no data is available.

Return Values

Data read from the socket.

Example

Capy

var handle := socket_connect("127.0.0.1", 1)
if handle != 0 { print(socket_read(handle, 64, 1), "\n"); socket_close(handle) }