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
56630b9e
Commit
56630b9e
authored
Mar 01, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 网关也添加心跳
parent
2f893701
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
connection.py
coco/connection.py
+4
-2
No files found.
coco/connection.py
View file @
56630b9e
...
@@ -68,7 +68,7 @@ class SSHConnection:
...
@@ -68,7 +68,7 @@ class SSHConnection:
look_for_keys
=
False
,
sock
=
sock
,
allow_agent
=
False
,
look_for_keys
=
False
,
sock
=
sock
,
allow_agent
=
False
,
)
)
transport
=
ssh
.
get_transport
()
transport
=
ssh
.
get_transport
()
transport
.
set_keepalive
(
30
0
)
transport
.
set_keepalive
(
2
0
)
except
Exception
as
e
:
except
Exception
as
e
:
password_short
=
"None"
password_short
=
"None"
key_fingerprint
=
"None"
key_fingerprint
=
"None"
...
@@ -132,7 +132,9 @@ class SSHConnection:
...
@@ -132,7 +132,9 @@ class SSHConnection:
except
:
except
:
continue
continue
try
:
try
:
sock
=
ssh
.
get_transport
()
.
open_channel
(
transport
=
ssh
.
get_transport
()
transport
.
set_keep_alive
(
20
)
sock
=
transport
.
open_channel
(
'direct-tcpip'
,
(
asset
.
ip
,
asset
.
port
),
(
'127.0.0.1'
,
0
)
'direct-tcpip'
,
(
asset
.
ip
,
asset
.
port
),
(
'127.0.0.1'
,
0
)
)
)
break
break
...
...
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