forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyConnApsect.py
More file actions
27 lines (22 loc) · 780 Bytes
/
Copy pathMyConnApsect.py
File metadata and controls
27 lines (22 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: MyConnApsect
@Time: 2025/3/30 21:13
@Desc:
"""
from pycgraph import GAspect, CStatus
class MyConnAspect(GAspect):
def __init__(self, ip: str, port: int):
super().__init__()
self.ip_ = ip
self.port_ = port
def beginRun(self):
print(' ----> [MyConnAspect] [{0} : {1}] has been connected...'.format(self.ip_, self.port_))
return CStatus()
def finishRun(self, curStatus: CStatus):
if curStatus.isOK():
print(' <---- [MyConnAspect] [{0} : {1}] has been connected...'.format(self.ip_, self.port_))
else:
print(' <---- [MyConnAspect] [{0} : {1}] is already been disconnected...'.format(self.ip_, self.port_))
return