Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
controlhost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
km3py
controlhost
Commits
c22fb3ef
Commit
c22fb3ef
authored
9 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Better buffer handling
parent
26c50d69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controlhost/__init__.py
+5
-1
5 additions, 1 deletion
controlhost/__init__.py
with
5 additions
and
1 deletion
controlhost/__init__.py
+
5
−
1
View file @
c22fb3ef
...
...
@@ -22,6 +22,9 @@ __email__ = "tgal@km3net.de"
__status__
=
"
Development
"
BUFFER_SIZE
=
1024
class
Client
(
object
):
"""
The ControlHost client
"""
def
__init__
(
self
,
host
,
port
=
5553
):
...
...
@@ -60,7 +63,8 @@ class Client(object):
prefix
=
Prefix
(
data
=
self
.
socket
.
recv
(
Prefix
.
SIZE
))
message
=
''
while
len
(
message
)
<
prefix
.
length
:
message
+=
self
.
socket
.
recv
(
1024
)
buffer_size
=
min
((
BUFFER_SIZE
,
(
prefix
.
length
-
len
(
message
))))
message
+=
self
.
socket
.
recv
(
buffer_size
)
return
prefix
,
message
def
_connect
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment