portal 3.4.0__tar.gz → 3.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {portal-3.4.0/portal.egg-info → portal-3.4.1}/PKG-INFO +1 -1
- {portal-3.4.0 → portal-3.4.1}/portal/__init__.py +1 -1
- {portal-3.4.0 → portal-3.4.1}/portal/client_socket.py +2 -2
- {portal-3.4.0 → portal-3.4.1}/portal/contextlib.py +5 -2
- {portal-3.4.0 → portal-3.4.1}/portal/server_socket.py +3 -2
- {portal-3.4.0 → portal-3.4.1/portal.egg-info}/PKG-INFO +1 -1
- {portal-3.4.0 → portal-3.4.1}/LICENSE +0 -0
- {portal-3.4.0 → portal-3.4.1}/MANIFEST.in +0 -0
- {portal-3.4.0 → portal-3.4.1}/README.md +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/batching.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/buffers.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/client.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/packlib.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/poollib.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/process.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/server.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/sharray.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/thread.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal/utils.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal.egg-info/SOURCES.txt +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal.egg-info/dependency_links.txt +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal.egg-info/requires.txt +0 -0
- {portal-3.4.0 → portal-3.4.1}/portal.egg-info/top_level.txt +0 -0
- {portal-3.4.0 → portal-3.4.1}/pyproject.toml +0 -0
- {portal-3.4.0 → portal-3.4.1}/requirements.txt +0 -0
- {portal-3.4.0 → portal-3.4.1}/setup.cfg +0 -0
- {portal-3.4.0 → portal-3.4.1}/setup.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_batching.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_client.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_errfile.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_pack.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_process.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_server.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_socket.py +0 -0
- {portal-3.4.0 → portal-3.4.1}/tests/test_thread.py +0 -0
@@ -190,7 +190,6 @@ class ClientSocket:
|
|
190
190
|
port = int(port)
|
191
191
|
addr = (host, port, 0, 0) if self.options.ipv6 else (host, port)
|
192
192
|
sock = self._create()
|
193
|
-
start = time.time()
|
194
193
|
error = None
|
195
194
|
try:
|
196
195
|
sock.settimeout(10)
|
@@ -214,9 +213,10 @@ class ClientSocket:
|
|
214
213
|
def _create(self):
|
215
214
|
if self.options.ipv6:
|
216
215
|
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
216
|
+
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
|
217
217
|
else:
|
218
218
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
219
|
-
# sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
219
|
+
# sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) # TODO
|
220
220
|
|
221
221
|
after = self.options.keepalive_after
|
222
222
|
every = self.options.keepalive_every
|
@@ -21,10 +21,13 @@ class Context:
|
|
21
21
|
self.interval = 20
|
22
22
|
self.clientkw = {}
|
23
23
|
self.serverkw = {}
|
24
|
+
self.printlock = threading.Lock()
|
24
25
|
self.done = threading.Event()
|
25
26
|
self.watcher = None
|
26
|
-
|
27
|
-
|
27
|
+
|
28
|
+
@property
|
29
|
+
def mp(self):
|
30
|
+
return mp.get_context('spawn')
|
28
31
|
|
29
32
|
def options(self):
|
30
33
|
return {
|
@@ -43,16 +43,17 @@ class ServerSocket:
|
|
43
43
|
self.options = Options(**{**contextlib.context.serverkw, **kwargs})
|
44
44
|
if self.options.ipv6:
|
45
45
|
self.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
46
|
+
self.sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
|
46
47
|
self.addr = (self.options.host or '::', port, 0, 0)
|
47
48
|
else:
|
48
49
|
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
49
50
|
self.addr = (self.options.host or '0.0.0.0', port)
|
50
51
|
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
51
|
-
# self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
52
|
+
# self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) # TODO
|
52
53
|
self._log(f'Binding to {self.addr[0]}:{self.addr[1]}')
|
53
54
|
self.sock.bind(self.addr)
|
54
55
|
self.sock.setblocking(False)
|
55
|
-
self.sock.listen()
|
56
|
+
self.sock.listen(8192)
|
56
57
|
self.sel = selectors.DefaultSelector()
|
57
58
|
self.sel.register(self.sock, selectors.EVENT_READ, data=None)
|
58
59
|
self._log(f'Listening at {self.addr[0]}:{self.addr[1]}')
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|