Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
cd4a22d8
Commit
cd4a22d8
authored
Jul 25, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 添加和客户端保持心跳
parent
25a447dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
connection.py
coco/connection.py
+2
-2
sshd.py
coco/sshd.py
+1
-0
No files found.
coco/connection.py
View file @
cd4a22d8
...
...
@@ -127,7 +127,7 @@ class SSHConnection:
look_for_keys
=
False
,
sock
=
sock
,
allow_agent
=
False
,
)
transport
=
ssh
.
get_transport
()
transport
.
set_keepalive
(
2
0
)
transport
.
set_keepalive
(
6
0
)
self
.
transport
=
transport
except
Exception
as
e
:
password_short
=
"None"
...
...
@@ -227,7 +227,7 @@ class SSHConnection:
continue
try
:
transport
=
ssh
.
get_transport
()
transport
.
set_keepalive
(
2
0
)
transport
.
set_keepalive
(
6
0
)
sock
=
transport
.
open_channel
(
'direct-tcpip'
,
(
asset
.
ip
,
asset
.
ssh_port
),
(
'127.0.0.1'
,
0
)
)
...
...
coco/sshd.py
View file @
cd4a22d8
...
...
@@ -77,6 +77,7 @@ class SSHServer:
server
=
SSHInterface
(
connection
)
try
:
transport
.
start_server
(
server
=
server
)
transport
.
set_keepalive
(
60
)
while
transport
.
is_active
():
chan
=
transport
.
accept
()
server
.
event
.
wait
(
5
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment