socket.d 2.5.1__tar.gz → 2.5.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {socket.d-2.5.1 → socket.d-2.5.2}/PKG-INFO +1 -1
- {socket.d-2.5.1 → socket.d-2.5.2}/setup.py +1 -1
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/PKG-INFO +1 -1
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/SOURCES.txt +2 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/SocketD.py +1 -1
- socket.d-2.5.2/socketd/broker/BroadcastBroker.py +12 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/broker/BrokerListener.py +31 -10
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/cluster/ClusterClientSession.py +6 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/cluster/LoadBalancer.py +3 -2
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientSession.py +4 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/SessionBase.py +3 -0
- socket.d-2.5.2/socketd/utils/SessionUtils.py +11 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/README.md +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/setup.cfg +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/dependency_links.txt +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/requires.txt +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/top_level.txt +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socket.d.egg-info/zip-safe +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/broker/BrokerFragmentHandler.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/broker/BrokerListenerBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/broker/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/cluster/ClusterClient.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/cluster/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/exception/SocketDExecption.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/exception/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/Client.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientChannel.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientConfig.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientConfigHandler.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientConnectHandler.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientConnector.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientConnectorBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientHandshakeResult.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientHeartbeatHandler.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/ClientProvider.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/client/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Asserts.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Channel.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/ChannelAssistant.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/ChannelInternal.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/ChannelSupporter.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Codec.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Config.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Costants.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Entity.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/EntityMetas.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Flags.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/FragmentAggregator.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/FragmentHandler.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Frame.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Frames.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/HandshakeDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/IdGenerator.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Listener.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Message.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Processor.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/Session.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/codec/Buffer.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/codec/ByteBufferCodecReader.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/codec/ByteBufferCodecWriter.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/codec/CodecDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/codec/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/EntityDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/FileEntity.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/MessageBuilder.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/MessageDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/StringEntity.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/entity/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/FragmentAggregatorDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/FragmentHandlerBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/FragmentHandlerDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/FragmentHolder.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/ChannelBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/ChannelDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/ConfigBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/ProcessorDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/SessionDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/impl/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/EventListener.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/PathListener.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/PipelineListener.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/RouteSelector.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/RouteSelectorDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/SimpleListener.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/listener/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/server/Server.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/server/ServerBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/server/ServerConfig.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/server/ServerProvider.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/server/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/RequestStream.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/SendStream.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/Stream.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/StreamManger.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/StreamMangerDefault.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/SubscribeStream.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/impl/RequestStreamImpl.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/impl/SendStreamImpl.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/impl/StreamBase.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/impl/SubscribeStreamImpl.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/stream/impl/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/AsyncUtils.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/CompletableFuture.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/LogConfig.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/MapUtils.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/RunUtils.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/StrUtils.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/async_api/AtomicRefer.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/async_api/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/sync_api/AtomicRefer.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd/utils/sync_api/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TCPAIOServer.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TCPStreamIO.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TcpAIOChannelAssistant.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TcpAioClient.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TcpAioClientConnector.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/TcpAioProvider.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_aio_tcp/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/WsAioChannelAssistant.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/WsAioClient.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/WsAioClientConnector.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/WsAioProvider.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/WsAioServer.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/__init__.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/impl/AIOConnect.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/impl/AIOServe.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/impl/AIOWebSocketClientImpl.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/impl/AIOWebSocketServerImpl.py +0 -0
- {socket.d-2.5.1 → socket.d-2.5.2}/socketd_websocket/impl/__init__.py +0 -0
@@ -8,6 +8,7 @@ socket.d.egg-info/top_level.txt
|
|
8
8
|
socket.d.egg-info/zip-safe
|
9
9
|
socketd/SocketD.py
|
10
10
|
socketd/__init__.py
|
11
|
+
socketd/broker/BroadcastBroker.py
|
11
12
|
socketd/broker/BrokerFragmentHandler.py
|
12
13
|
socketd/broker/BrokerListener.py
|
13
14
|
socketd/broker/BrokerListenerBase.py
|
@@ -106,6 +107,7 @@ socketd/utils/CompletableFuture.py
|
|
106
107
|
socketd/utils/LogConfig.py
|
107
108
|
socketd/utils/MapUtils.py
|
108
109
|
socketd/utils/RunUtils.py
|
110
|
+
socketd/utils/SessionUtils.py
|
109
111
|
socketd/utils/StrUtils.py
|
110
112
|
socketd/utils/__init__.py
|
111
113
|
socketd/utils/async_api/AtomicRefer.py
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import abc
|
2
|
+
|
3
|
+
from socketd.transport.core import Entity
|
4
|
+
|
5
|
+
# 广播经纪人
|
6
|
+
class BroadcastBroker:
|
7
|
+
# 广播
|
8
|
+
# @param event 事件
|
9
|
+
# @param entity 实体(转发方式 https://socketd.noear.org/article/737 )
|
10
|
+
@abc.abstractmethod
|
11
|
+
def broadcast(self, event:str, entity:Entity):
|
12
|
+
...
|
@@ -1,11 +1,17 @@
|
|
1
|
+
from socketd.broker.BroadcastBroker import BroadcastBroker
|
1
2
|
from socketd.broker.BrokerListenerBase import BrokerListenerBase
|
3
|
+
from socketd.exception.SocketDExecption import SocketDException
|
2
4
|
from socketd.transport.core import Entity
|
5
|
+
from socketd.transport.core.Flags import Flags
|
3
6
|
from socketd.transport.core.Message import Message
|
4
7
|
from socketd.transport.core.Session import Session
|
8
|
+
from socketd.transport.core.entity.MessageBuilder import MessageBuilder
|
9
|
+
from socketd.utils.LogConfig import log
|
10
|
+
from socketd.utils.SessionUtils import SessionUtils
|
5
11
|
|
6
12
|
|
7
13
|
# 经纪人监听器(为不同的玩家转发消息)
|
8
|
-
class BrokerListener(BrokerListenerBase):
|
14
|
+
class BrokerListener(BrokerListenerBase, BroadcastBroker):
|
9
15
|
def __init__(self):
|
10
16
|
super().__init__()
|
11
17
|
|
@@ -21,7 +27,10 @@ class BrokerListener(BrokerListenerBase):
|
|
21
27
|
atName = message.at_name()
|
22
28
|
|
23
29
|
if atName is None:
|
24
|
-
|
30
|
+
if requester:
|
31
|
+
await requester.send_alarm(message, "Broker message require '@' meta")
|
32
|
+
else:
|
33
|
+
raise SocketDException("Broker message require '@' meta")
|
25
34
|
return
|
26
35
|
|
27
36
|
if atName.__eq__("*"):
|
@@ -34,13 +43,26 @@ class BrokerListener(BrokerListenerBase):
|
|
34
43
|
# 群发模式(给同名的所有玩家)
|
35
44
|
atName = atName[:-1]
|
36
45
|
if not self.forward_to_name(requester, message, atName):
|
37
|
-
|
46
|
+
if requester:
|
47
|
+
await requester.send_alarm(message, "Broker don't have '@" + atName + "' player")
|
48
|
+
else:
|
49
|
+
raise SocketDException("Broker don't have '@" + atName + "' player")
|
38
50
|
else:
|
39
51
|
responder = self.get_player_any(atName, requester, message)
|
40
52
|
if responder is not None:
|
41
53
|
self.forward_to_session(requester, message, responder)
|
42
54
|
else:
|
43
|
-
|
55
|
+
if requester:
|
56
|
+
await requester.send_alarm(message, "Broker don't have '@" + atName + "' session")
|
57
|
+
else:
|
58
|
+
raise SocketDException("Broker don't have '@" + atName + "' session")
|
59
|
+
|
60
|
+
# 广播
|
61
|
+
def broadcast(self, event:str, entity:Entity):
|
62
|
+
self.onMessage(None, MessageBuilder()
|
63
|
+
.flag(Flags.Message)
|
64
|
+
.event(event)
|
65
|
+
.entity(entity).build())
|
44
66
|
|
45
67
|
# 批量转发消息
|
46
68
|
def forward_to_name(self, requester: Session, message: Message, name: str) -> bool:
|
@@ -61,11 +83,11 @@ class BrokerListener(BrokerListenerBase):
|
|
61
83
|
def forward_to_session(self, requester: Session, message: Message, responder: Session):
|
62
84
|
if message.is_request():
|
63
85
|
def then_reply(reply: Entity):
|
64
|
-
if
|
86
|
+
if SessionUtils.is_valid(requester):
|
65
87
|
requester.reply(message, reply)
|
66
88
|
|
67
89
|
def then_error(err: Exception):
|
68
|
-
if
|
90
|
+
if SessionUtils.is_valid(requester):
|
69
91
|
requester.send_alarm(message, err)
|
70
92
|
|
71
93
|
responder.send_and_request(message.event(), message, -1).then_reply(then_reply).then_error(then_error)
|
@@ -73,14 +95,14 @@ class BrokerListener(BrokerListenerBase):
|
|
73
95
|
|
74
96
|
if message.is_subscribe():
|
75
97
|
def then_reply(reply: Entity):
|
76
|
-
if
|
98
|
+
if SessionUtils.is_valid(requester):
|
77
99
|
if message.is_end():
|
78
100
|
requester.reply_end(message, reply)
|
79
101
|
else:
|
80
102
|
requester.reply(message, reply)
|
81
103
|
|
82
104
|
def then_error(err: Exception):
|
83
|
-
if
|
105
|
+
if SessionUtils.is_valid(requester):
|
84
106
|
requester.send_alarm(message, err)
|
85
107
|
|
86
108
|
responder.send_and_subscribe(message.event(), message, -1).then_reply(then_reply).then_error(then_error)
|
@@ -89,5 +111,4 @@ class BrokerListener(BrokerListenerBase):
|
|
89
111
|
responder.send(message.event(), message)
|
90
112
|
|
91
113
|
def on_error(self, session: Session, error):
|
92
|
-
|
93
|
-
# log.warning("Broker error", error)
|
114
|
+
log.warning("Broker error", error)
|
@@ -36,6 +36,12 @@ class ClusterClientSession(ClientSession):
|
|
36
36
|
return True
|
37
37
|
return False
|
38
38
|
|
39
|
+
def is_active(self) -> bool:
|
40
|
+
for session in self.__sessionSet:
|
41
|
+
if session.is_active():
|
42
|
+
return True
|
43
|
+
return False
|
44
|
+
|
39
45
|
def is_closing(self) -> bool:
|
40
46
|
for session in self.__sessionSet:
|
41
47
|
if session.is_closing():
|
@@ -2,6 +2,7 @@ from threading import RLock
|
|
2
2
|
from typing import List
|
3
3
|
|
4
4
|
from socketd.transport.client.ClientSession import ClientSession
|
5
|
+
from socketd.utils.SessionUtils import SessionUtils
|
5
6
|
from socketd.utils.StrUtils import StrUtils
|
6
7
|
|
7
8
|
|
@@ -39,7 +40,7 @@ class LoadBalancer:
|
|
39
40
|
else:
|
40
41
|
sessions: List[ClientSession] = []
|
41
42
|
for s in coll:
|
42
|
-
if
|
43
|
+
if SessionUtils.is_active(s):
|
43
44
|
sessions.append(s)
|
44
45
|
|
45
46
|
if sessions.__len__() == 0:
|
@@ -59,7 +60,7 @@ class LoadBalancer:
|
|
59
60
|
return None
|
60
61
|
else:
|
61
62
|
for s in coll:
|
62
|
-
if
|
63
|
+
if SessionUtils.is_active(s):
|
63
64
|
return s
|
64
65
|
|
65
66
|
return None
|
@@ -48,6 +48,9 @@ class SessionBase(Session, ABC):
|
|
48
48
|
def session_id(self) -> str:
|
49
49
|
return self._session_id
|
50
50
|
|
51
|
+
def is_active(self) -> bool:
|
52
|
+
return self.is_valid() and self.is_closing() == False
|
53
|
+
|
51
54
|
def live_time(self)->int:
|
52
55
|
return self._channel.get_live_time()
|
53
56
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from socketd.transport.client.ClientSession import ClientSession
|
2
|
+
|
3
|
+
# 会话工具(主要检测状态)
|
4
|
+
class SessionUtils:
|
5
|
+
@staticmethod
|
6
|
+
def is_active(s: ClientSession) -> bool:
|
7
|
+
return s and s.is_active()
|
8
|
+
|
9
|
+
@staticmethod
|
10
|
+
def is_valid(s: ClientSession) -> bool:
|
11
|
+
return s and s.is_valid()
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{socket.d-2.5.1 → socket.d-2.5.2}/socketd/transport/core/fragment/FragmentAggregatorDefault.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
|
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
|