diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-10-27 00:27:27 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-10-27 00:27:27 +0300 |
commit | a33fca99a1cc9d2026ee56e81f372c1e695379f5 (patch) | |
tree | 30a778c4e9d5396ddab3dfaf2da4aa4dfb91f725 /docs/library | |
parent | d1cd533134cc115dfe15e6c22d60bb7fd7589d88 (diff) |
docs/usocket: Document inet_ntop(), inet_pton().
Diffstat (limited to 'docs/library')
-rw-r--r-- | docs/library/usocket.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/library/usocket.rst b/docs/library/usocket.rst index a3e987a07..53936505b 100644 --- a/docs/library/usocket.rst +++ b/docs/library/usocket.rst @@ -105,6 +105,22 @@ Functions from an exception object). The use of negative values is a provisional detail which may change in the future. +.. function:: inet_ntop(af, bin_addr) + + Convert a binary network address *bin_addr* of the given address family *af* + to a textual representation:: + + >>> usocket.inet_ntop(usocket.AF_INET, b"\x7f\0\0\1") + '127.0.0.1' + +.. function:: inet_pton(af, txt_addr) + + Convert a textual network address *txt_addr* of the given address family *af* + to a binary representation:: + + >>> usocket.inet_pton(usocket.AF_INET, "1.2.3.4") + b'\x01\x02\x03\x04' + Constants --------- |