Skip to content

Commit

Permalink
Documentation: Fixed missing documentation on socket addresses and cl…
Browse files Browse the repository at this point in the history
…ient attributes
  • Loading branch information
francis-clairicia committed Nov 4, 2024
1 parent 872339f commit 7492835
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/source/api/servers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Client API
:special-members: __eq__, __hash__


Client Attributes
-----------------

.. autoclass:: INETClientAttribute
:members:


------

Server implementation tools
Expand Down
6 changes: 6 additions & 0 deletions src/easynetwork/lowlevel/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"IPv4SocketAddress",
"IPv6SocketAddress",
"ISocket",
"SocketAddress",
"SocketAttribute",
"SocketProxy",
"SupportsSocketOptions",
Expand Down Expand Up @@ -130,6 +131,8 @@ class TLSAttribute(typed_attr.TypedAttributeSet):


class IPv4SocketAddress(NamedTuple):
"""An internet (IPv4) socket address."""

host: str
port: int

Expand All @@ -145,6 +148,8 @@ def for_connection(self) -> tuple[str, int]:


class IPv6SocketAddress(NamedTuple):
"""An internet (IPv6) socket address."""

host: str
port: int
flowinfo: int = 0
Expand All @@ -162,6 +167,7 @@ def for_connection(self) -> tuple[str, int]:


SocketAddress: TypeAlias = IPv4SocketAddress | IPv6SocketAddress
"""An internet socket address, either IPv4 or IPv6."""


@overload
Expand Down
4 changes: 4 additions & 0 deletions src/easynetwork/servers/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@


class INETClientAttribute(typed_attr.TypedAttributeSet):
"""
Typed attributes which can be used on an :class:`AsyncBaseClientInterface`.
"""

__slots__ = ()

socket: socket_tools.ISocket = socket_tools.SocketAttribute.socket
Expand Down

0 comments on commit 7492835

Please sign in to comment.