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
89596c87
Commit
89596c87
authored
Dec 26, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 捕捉异常
parent
778493ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
models.py
coco/models.py
+1
-1
session.py
coco/session.py
+4
-2
No files found.
coco/models.py
View file @
89596c87
...
@@ -125,7 +125,7 @@ class Client(object):
...
@@ -125,7 +125,7 @@ class Client(object):
def
send
(
self
,
b
):
def
send
(
self
,
b
):
try
:
try
:
return
self
.
chan
.
send
(
b
)
return
self
.
chan
.
send
(
b
)
except
EOFError
:
except
(
EOFError
,
OSError
)
:
return
0
return
0
def
send_unicode
(
self
,
s
):
def
send_unicode
(
self
,
s
):
...
...
coco/session.py
View file @
89596c87
...
@@ -166,10 +166,12 @@ class Session:
...
@@ -166,10 +166,12 @@ class Session:
self
.
sel
.
register
(
self
.
server
,
selectors
.
EVENT_READ
)
self
.
sel
.
register
(
self
.
server
,
selectors
.
EVENT_READ
)
self
.
sel
.
register
(
self
.
stop_evt
,
selectors
.
EVENT_READ
)
self
.
sel
.
register
(
self
.
stop_evt
,
selectors
.
EVENT_READ
)
self
.
sel
.
register
(
self
.
client
.
change_size_evt
,
selectors
.
EVENT_READ
)
self
.
sel
.
register
(
self
.
client
.
change_size_evt
,
selectors
.
EVENT_READ
)
if
self
.
client
.
closed
:
return
while
not
self
.
is_finished
:
while
not
self
.
is_finished
:
events
=
self
.
sel
.
select
(
timeout
=
60
)
events
=
self
.
sel
.
select
(
timeout
=
60
)
if
self
.
client
.
closed
:
break
if
self
.
server
.
closed
:
break
for
sock
in
[
key
.
fileobj
for
key
,
_
in
events
]:
for
sock
in
[
key
.
fileobj
for
key
,
_
in
events
]:
data
=
sock
.
recv
(
BUF_SIZE
)
data
=
sock
.
recv
(
BUF_SIZE
)
if
sock
==
self
.
server
:
if
sock
==
self
.
server
:
...
...
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