Skip to content

Commit

Permalink
feat: remove undocumented use of raw_socket in anyio
Browse files Browse the repository at this point in the history
  • Loading branch information
standy66 committed Jul 22, 2019
1 parent 2144e5e commit 6de2c9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def main():
python_requires=">=3.5",
install_requires=[
"h2>=3.1.0,<4",
"protobuf~=3.6",
"anyio>=1.0.0b2,<2",
"protobuf>=3.5.1,<4",
"anyio>=1.0.0,<2",
"async_exit_stack>=1.0.1,<2",
"tblib>=1.3.2,<2",
"async_generator>=1.10,<2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/purerpc/grpc_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


class SocketWrapper(async_exit_stack.AsyncExitStack):
def __init__(self, grpc_connection: GRPCConnection, sock: anyio._networking.SocketStream):
def __init__(self, grpc_connection: GRPCConnection, sock: anyio.SocketStream):
super().__init__()
self._set_socket_options(sock._socket._raw_socket)
self._set_socket_options(sock)
self._socket = sock
self._grpc_connection = grpc_connection
self._flush_event = anyio.create_event()
Expand All @@ -37,7 +37,7 @@ async def callback():
return self

@staticmethod
def _set_socket_options(sock):
def _set_socket_options(sock: anyio.SocketStream):
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
if hasattr(socket, "TCP_KEEPIDLE"):
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 300)
Expand Down

0 comments on commit 6de2c9a

Please sign in to comment.