socket.d 2.4.14.2__tar.gz → 2.4.14.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/PKG-INFO +1 -1
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/setup.py +1 -1
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/PKG-INFO +1 -1
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/cluster/ClusterClientSession.py +2 -2
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientSession.py +2 -2
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/SessionDefault.py +15 -7
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/RequestStreamImpl.py +2 -1
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/SendStreamImpl.py +2 -2
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/StreamBase.py +8 -7
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/impl/AIOWebSocketServerImpl.py +17 -13
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/README.md +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/setup.cfg +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/SOURCES.txt +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/dependency_links.txt +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/requires.txt +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/top_level.txt +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socket.d.egg-info/zip-safe +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/SocketD.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/broker/BrokerFragmentHandler.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/broker/BrokerListener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/broker/BrokerListenerBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/broker/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/cluster/ClusterClient.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/cluster/LoadBalancer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/cluster/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/exception/SocketDExecption.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/exception/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/Client.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientChannel.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientConfig.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientConfigHandler.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientConnectHandler.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientConnector.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientConnectorBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientHandshakeResult.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientHeartbeatHandler.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/ClientProvider.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/client/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Asserts.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Channel.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/ChannelAssistant.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/ChannelInternal.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/ChannelSupporter.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Codec.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Config.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Costants.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Entity.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/EntityMetas.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Flags.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/FragmentAggregator.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/FragmentHandler.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Frame.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Frames.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/HandshakeDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/IdGenerator.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Listener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Message.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Processor.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/Session.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/Buffer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/ByteBufferCodecReader.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/ByteBufferCodecWriter.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/CodecDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/EntityDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/FileEntity.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/MessageBuilder.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/MessageDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/StringEntity.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/entity/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentAggregatorDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentHandlerBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentHandlerDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentHolder.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/ChannelBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/ChannelDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/ConfigBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/ProcessorDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/SessionBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/impl/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/EventListener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/PathListener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/PipelineListener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/RouteSelector.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/RouteSelectorDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/SimpleListener.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/server/Server.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/server/ServerBase.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/server/ServerConfig.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/server/ServerProvider.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/server/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/RequestStream.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/SendStream.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/Stream.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/StreamManger.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/StreamMangerDefault.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/SubscribeStream.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/SubscribeStreamImpl.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/AsyncUtils.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/CompletableFuture.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/LogConfig.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/MapUtils.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/RunUtils.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/StrUtils.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/async_api/AtomicRefer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/async_api/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/sync_api/AtomicRefer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/utils/sync_api/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TCPAIOServer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TCPStreamIO.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TcpAIOChannelAssistant.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TcpAioClient.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TcpAioClientConnector.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/TcpAioProvider.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_aio_tcp/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/WsAioChannelAssistant.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/WsAioClient.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/WsAioClientConnector.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/WsAioProvider.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/WsAioServer.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/__init__.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/impl/AIOConnect.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/impl/AIOServe.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/impl/AIOWebSocketClientImpl.py +0 -0
- {socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd_websocket/impl/__init__.py +0 -0
@@ -50,12 +50,12 @@ class ClusterClientSession(ClientSession):
|
|
50
50
|
|
51
51
|
return sender.send(event, content)
|
52
52
|
|
53
|
-
def send_and_request(self, event: str, content: Entity, timeout:
|
53
|
+
def send_and_request(self, event: str, content: Entity, timeout: float = 0) -> RequestStream:
|
54
54
|
sender = self.get_session_any(None)
|
55
55
|
|
56
56
|
return sender.send_and_request(event, content, timeout)
|
57
57
|
|
58
|
-
def send_and_subscribe(self, event: str, content: Entity, timeout:
|
58
|
+
def send_and_subscribe(self, event: str, content: Entity, timeout: float = 0) -> SubscribeStream:
|
59
59
|
sender = self.get_session_any(None)
|
60
60
|
|
61
61
|
return sender.send_and_subscribe(event, content, timeout)
|
@@ -25,11 +25,11 @@ class ClientSession:
|
|
25
25
|
...
|
26
26
|
|
27
27
|
@abc.abstractmethod
|
28
|
-
def send_and_request(self, event: str, content: Entity, timeout:
|
28
|
+
def send_and_request(self, event: str, content: Entity, timeout: float = 0) -> RequestStream:
|
29
29
|
...
|
30
30
|
|
31
31
|
@abc.abstractmethod
|
32
|
-
def send_and_subscribe(self, event: str, content: Entity, timeout:
|
32
|
+
def send_and_subscribe(self, event: str, content: Entity, timeout: float = 0) -> SubscribeStream:
|
33
33
|
...
|
34
34
|
|
35
35
|
@abc.abstractmethod
|
@@ -53,20 +53,28 @@ class SessionDefault(SessionBase):
|
|
53
53
|
RunUtils.taskTry(self._channel.send(Frame(Flags.Message, message), stream))
|
54
54
|
return stream
|
55
55
|
|
56
|
-
def send_and_request(self, event: str, content: Entity,
|
57
|
-
timeout: int|None = 100) -> RequestStream:
|
58
|
-
|
56
|
+
def send_and_request(self, event: str, content: Entity, timeout: float|None = 0) -> RequestStream:
|
59
57
|
if timeout is None:
|
60
|
-
timeout =
|
58
|
+
timeout = 0
|
59
|
+
|
60
|
+
if timeout < 0:
|
61
|
+
timeout = self._channel.get_config().get_stream_timeout()
|
62
|
+
|
63
|
+
if timeout == 0:
|
64
|
+
timeout = self._channel.get_config().get_request_timeout()
|
61
65
|
|
62
|
-
if timeout < 100:
|
63
|
-
timeout = self._channel.get_config().get_request_timeout() / 1000
|
64
66
|
message = MessageBuilder().sid(self.generate_id()).event(event).entity(content).build()
|
65
67
|
stream:RequestStream = RequestStreamImpl(message.sid(), timeout)
|
66
68
|
RunUtils.taskTry(self._channel.send(Frame(Flags.Request, message), stream))
|
67
69
|
return stream
|
68
70
|
|
69
|
-
def send_and_subscribe(self, event: str, content: Entity, timeout:
|
71
|
+
def send_and_subscribe(self, event: str, content: Entity, timeout: float = 0):
|
72
|
+
if timeout is None:
|
73
|
+
timeout = 0
|
74
|
+
|
75
|
+
if timeout <= 0:
|
76
|
+
timeout = self._channel.get_config().get_stream_timeout()
|
77
|
+
|
70
78
|
message = MessageBuilder().sid(self.generate_id()).event(event).entity(content).build()
|
71
79
|
stream:SubscribeStream = SubscribeStreamImpl(message.sid(), timeout)
|
72
80
|
RunUtils.taskTry(self._channel.send(Frame(Flags.Subscribe, message), stream))
|
@@ -8,6 +8,7 @@ from socketd.transport.core.Message import MessageInternal
|
|
8
8
|
from socketd.transport.stream.RequestStream import RequestStream
|
9
9
|
from socketd.transport.stream.impl.StreamBase import StreamBase
|
10
10
|
from socketd.utils.CompletableFuture import CompletableFuture
|
11
|
+
from socketd.utils.RunUtils import RunUtils
|
11
12
|
|
12
13
|
|
13
14
|
class RequestStreamImpl(StreamBase, RequestStream):
|
@@ -41,7 +42,7 @@ class RequestStreamImpl(StreamBase, RequestStream):
|
|
41
42
|
def then_reply(self, onReply: Callable[[MessageInternal], None]) -> RequestStream:
|
42
43
|
async def _then_reply_do(r: MessageInternal, e: Exception):
|
43
44
|
if r:
|
44
|
-
onReply(r)
|
45
|
+
await RunUtils.waitTry(onReply(r))
|
45
46
|
self.__future.then_async_callback(_then_reply_do)
|
46
47
|
return self
|
47
48
|
|
@@ -16,10 +16,10 @@ class SendStreamImpl(StreamBase, SendStream):
|
|
16
16
|
...
|
17
17
|
|
18
18
|
def then_error(self, onError: Callable[[Exception], None]) -> 'SendStream':
|
19
|
-
|
19
|
+
self._then_error_do(onError)
|
20
20
|
return self
|
21
21
|
|
22
22
|
|
23
23
|
def then_progress(self, onProgress: Callable[[bool, int, int], None]) -> 'SendStream':
|
24
|
-
|
24
|
+
self.then_progress(onProgress)
|
25
25
|
return self
|
@@ -11,12 +11,13 @@ from socketd.utils.RunUtils import RunUtils
|
|
11
11
|
|
12
12
|
|
13
13
|
class StreamBase(StreamInternal, ABC):
|
14
|
-
"""流接收器基类
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
self.
|
19
|
-
self.
|
14
|
+
"""流接收器基类
|
15
|
+
:param timeout: 超时(毫秒)
|
16
|
+
"""
|
17
|
+
def __init__(self, sid: str, demands: int, timeout: float):
|
18
|
+
self.__sid:str = sid
|
19
|
+
self.__timeout:float = timeout
|
20
|
+
self.__demands:int = demands
|
20
21
|
|
21
22
|
self.__doOnError: Callable[[Exception], None] = None
|
22
23
|
self.__doOnProgress: Callable[[bool, int, int], None] = None
|
@@ -38,7 +39,7 @@ class StreamBase(StreamInternal, ABC):
|
|
38
39
|
def demands(self) -> int:
|
39
40
|
return self.__demands
|
40
41
|
|
41
|
-
def timeout(self):
|
42
|
+
def timeout(self) ->float:
|
42
43
|
return self.__timeout
|
43
44
|
|
44
45
|
# 保险开始(避免永久没有回调,造成内存不能释放)
|
@@ -1,9 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
import asyncio
|
3
|
-
import traceback
|
4
3
|
from typing import Optional, Union
|
5
4
|
|
6
|
-
from websockets import ConnectionClosedOK
|
5
|
+
from websockets import ConnectionClosedOK, ConnectionClosedError, ConnectionClosed
|
7
6
|
from websockets.frames import Opcode
|
8
7
|
from websockets.server import WebSocketServer, WebSocketServerProtocol
|
9
8
|
|
@@ -52,15 +51,18 @@ class AIOWebSocketServerImpl(WebSocketServerProtocol):
|
|
52
51
|
channel = ChannelDefault(conn, self.ws_aio_server)
|
53
52
|
self.set_attachment(channel)
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
54
|
+
def on_close(self, conn) -> None:
|
55
|
+
channel: ChannelInternal = conn.get_attachment()
|
56
|
+
if channel is not None:
|
57
|
+
# 有可能未 onOpen,就 onClose 了;此时通道未成
|
58
|
+
self.ws_aio_server.get_processor().on_close(channel)
|
59
|
+
|
60
|
+
|
61
|
+
def on_error(self, conn: Union[AIOWebSocketServerImpl, WebSocketServerProtocol], ex: Exception):
|
62
|
+
channel: ChannelInternal = conn.get_attachment()
|
63
|
+
if channel is not None:
|
64
|
+
# 有可能未 onOpen,就 onError 了;此时通道未成
|
65
|
+
self.ws_aio_server.get_processor().on_error(channel, ex)
|
64
66
|
|
65
67
|
async def on_message(self, conn: Union[AIOWebSocketServerImpl, WebSocketServerProtocol], path: str):
|
66
68
|
"""ws_handler"""
|
@@ -91,9 +93,11 @@ class AIOWebSocketServerImpl(WebSocketServerProtocol):
|
|
91
93
|
except asyncio.CancelledError as e:
|
92
94
|
break
|
93
95
|
except ConnectionClosedOK as e:
|
94
|
-
|
96
|
+
self.on_close(conn)
|
97
|
+
except ConnectionClosedError as e:
|
98
|
+
self.on_close(conn)
|
95
99
|
except Exception as e:
|
96
|
-
|
100
|
+
self.on_error(conn, e)
|
97
101
|
|
98
102
|
# 未签名前,禁止 ping/pong
|
99
103
|
async def assert_handshake(self) -> bool:
|
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
|
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
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/ByteBufferCodecReader.py
RENAMED
File without changes
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/codec/ByteBufferCodecWriter.py
RENAMED
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
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentAggregatorDefault.py
RENAMED
File without changes
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentHandlerBase.py
RENAMED
File without changes
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/fragment/FragmentHandlerDefault.py
RENAMED
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
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/core/listener/RouteSelectorDefault.py
RENAMED
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
|
{socket.d-2.4.14.2 → socket.d-2.4.14.5}/socketd/transport/stream/impl/SubscribeStreamImpl.py
RENAMED
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
|
File without changes
|