mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update doc/*/scripting/builtins/libnetwork.md
This commit is contained in:
parent
9e60a818e0
commit
ff079ef57b
2 changed files with 20 additions and 0 deletions
|
|
@ -82,6 +82,16 @@ socket:recv(
|
|||
-- Returns nil on error (socket is closed or does not exist).
|
||||
-- If there is no data yet, returns an empty byte array.
|
||||
|
||||
-- Asynchronous version for use in coroutines.
|
||||
-- Waits for the entire specified number of bytes to be received.
|
||||
-- If socket closes, function works like socket:recv
|
||||
socket:recv_async(
|
||||
-- Size of the byte array to read
|
||||
length: int,
|
||||
-- Use table instead of Bytearray
|
||||
[optional] usetable: bool=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
-- Closes the connection
|
||||
socket:close()
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,16 @@ socket:recv(
|
|||
-- В случае ошибки возвращает nil (сокет закрыт или несуществует).
|
||||
-- Если данных пока нет, возвращает пустой массив байт.
|
||||
|
||||
-- Асинхронный вариант для использования в корутинах.
|
||||
-- Ожидает получение всего указанного числа байт.
|
||||
-- При закрытии сокета работает как socket:recv
|
||||
socket:recv_async(
|
||||
-- Размер читаемого массива байт
|
||||
length: int,
|
||||
-- Использовать таблицу вместо Bytearray
|
||||
[опционально] usetable: bool=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
-- Закрывает соединение
|
||||
socket:close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue