Skip to content

Commit

Permalink
remote data in info map of tcpclientasync
Browse files Browse the repository at this point in the history
  • Loading branch information
Staars authored Jan 15, 2024
1 parent be24fac commit 451c132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Berry.md
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ close<a class="cmnd" id="tcpclientasync_close"></a>|`close() -> nil`<BR>Close th
write<a class="cmnd" id="tcpclientasync_write"></a>|`write(content:string or bytes) -> int`<BR>Accepts either a string or a bytes buffer, returns the number of bytes sent. It's you responsibility to resend the missing bytes.<BR>Returns `0` if something went wrong.
read<a class="cmnd" id="tcpclientasync_read"></a>|`read([max_len:int]) -> string`<BR>Returns all the bytes received in Rx buffer as `string`.<br>Optional `max_len` parameter limits the number of characters returned, or read as much as possible by default. However in the non-blocking version, limiting receive buffer will truncate (and lose) any extra data.
readbytes<a class="cmnd" id="tcpclientasync_readbytes"></a>|`read([max_bytes:int]) -> bytes()`<BR>Returns all the bytes received in Rx buffer as `bytes()`.<br>Optional `max_bytes` parameter limits the number of bytes returned, or read as much as possible by default. However in the non-blocking version, limiting receive buffer will truncate (and lose) any extra data.
info<a class="cmnd" id="tcpclientasync_info"></a>|`info() -> map`<BR>Returns a map with various information about the socket.<BR>Example: `{'listening': true, 'local_addr': '192.168.1.20', 'available': false, 'fd': 50, 'connected': true, 'local_port': 64808}`<BR>`fd`: the file descriptor number used internally<BR>`connected`, `listening`, `available`: values of corresponding methods<BR>`local_addr`, `local_port`: local address used and local port.
info<a class="cmnd" id="tcpclientasync_info"></a>|`info() -> map`<BR>Returns a map with various information about the socket.<BR>Example: `{'listening': true, 'local_addr': '192.168.1.20', 'available': false, 'fd': 50, 'remote_addr': '192.168.1.54', 'connected': true, 'local_port': 64808, 'remote_port': 53469}`<BR>`fd`: the file descriptor number used internally<BR>`connected`, `listening`, `available`: values of corresponding methods<BR>`remote_addr`, `remote_port`: remote address used and remote port<BR>`local_addr`, `local_port`: local address used and local port.


Full example:
Expand Down

0 comments on commit 451c132

Please sign in to comment.