mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
commit
968528c706
7 changed files with 73 additions and 7 deletions
|
|
@ -92,6 +92,21 @@ socket:recv_async(
|
|||
[optional] usetable: bool=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
-- `peek` and `peek_async` are analogous to the `recv` and `recv_async` methods
|
||||
-- with the exception that `peek` and `peek_async` do not advance the socket buffer position
|
||||
-- This means they do not remove bytes from the socket, so the bytes can be received after
|
||||
socket:peek(
|
||||
length: int,
|
||||
[optional] usetable: boolean=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
socket:peek_async(
|
||||
length: int,
|
||||
[optional] usetable: boolean=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
Translated with DeepL.com (free version)
|
||||
|
||||
-- Closes the connection
|
||||
socket:close()
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,19 @@ socket:recv_async(
|
|||
[опционально] usetable: boolean=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
-- `peek` и `peek_async` являются аналогами методов `recv` и `recv_async`
|
||||
-- за тем исключением, что `peek` и `peek_async` не двигают позицию буфера сокета
|
||||
-- Это означает, что они не удаляют байты из сокета, а значит байты могут быть прочитаны после
|
||||
socket:peek(
|
||||
length: int,
|
||||
[опционально] usetable: boolean=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
socket:peek_async(
|
||||
length: int,
|
||||
[опционально] usetable: boolean=false
|
||||
) -> nil|table|Bytearray
|
||||
|
||||
-- Оборачивает сокет в io_stream (см. ../io_stream.md)
|
||||
socket:as_stream(
|
||||
[опционально] binary_mode: boolean=true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue