Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Puls-o-matic Control
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Corvus
Puls-o-matic Control
Commits
6c3ec86f
Commit
6c3ec86f
authored
1 year ago
by
Corvus
Browse files
Options
Downloads
Patches
Plain Diff
Use actual server name
- Fix socket import
parent
3b595ba9
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client.py
+5
-5
5 additions, 5 deletions
client.py
with
5 additions
and
5 deletions
client.py
+
5
−
5
View file @
6c3ec86f
from
socket
import
socket
import
socket
def
parse_response
(
client_socket
:
socket
):
def
parse_response
(
client_socket
:
socket
.
socket
):
response_type
=
client_socket
.
recv
(
1
)
response_string_length
=
int
.
from_bytes
(
client_socket
.
recv
(
4
),
"
big
"
)
...
...
@@ -14,7 +14,7 @@ def parse_response(client_socket: socket):
print
(
response_string
)
def
send_string
(
string
:
str
,
client_socket
:
socket
):
def
send_string
(
string
:
str
,
client_socket
:
socket
.
socket
):
string_bytes
=
string
.
encode
(
"
utf-8
"
)
client_socket
.
send
(
len
(
string_bytes
).
to_bytes
(
4
,
"
big
"
))
client_socket
.
send
(
string_bytes
)
...
...
@@ -33,8 +33,8 @@ def print_commands():
while
True
:
print_commands
()
command
=
input
(
"
Enter Command:
"
)
client_socket
=
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
client_socket
.
connect
((
'
127.0.0.1
'
,
5080
))
client_socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
client_socket
.
connect
((
'
light.lan
'
,
5080
))
bye
=
False
if
command
==
"
1
"
:
'''
List Effects
'''
...
...
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