Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
bliss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
523
Issues
523
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
123
Merge Requests
123
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bliss
bliss
Commits
1a770a36
Commit
1a770a36
authored
Feb 11, 2020
by
Cyril Guilloud
Committed by
Cyril Guilloud
Feb 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp / udp __info__()
parent
2d2e226f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
bliss/comm/tcp.py
bliss/comm/tcp.py
+8
-0
bliss/comm/udp.py
bliss/comm/udp.py
+4
-0
doc/docs/dev_comm.md
doc/docs/dev_comm.md
+3
-1
No files found.
bliss/comm/tcp.py
View file @
1a770a36
...
...
@@ -327,6 +327,10 @@ class BaseSocket:
class
Socket
(
BaseSocket
):
def
__info__
(
self
):
info_str
=
f"TCP SOCKET: host=
{
self
.
_host
}
port=
{
self
.
_port
}
\n
"
return
info_str
def
_connect
(
self
,
host
,
port
):
fd
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
fd
.
setsockopt
(
socket
.
IPPROTO_TCP
,
socket
.
TCP_NODELAY
,
1
)
...
...
@@ -471,6 +475,10 @@ class Command:
def
__str__
(
self
):
return
f"
{
self
.
__class__
.
__name__
}
[
{
self
.
_host
}
:
{
self
.
_port
}
]"
def
__info__
(
self
):
info_str
=
"TCP COMMAND: host={self._host} port={self._port}
\n
"
return
info_str
@
property
def
lock
(
self
):
return
self
.
_lock
...
...
bliss/comm/udp.py
View file @
1a770a36
...
...
@@ -17,6 +17,10 @@ from bliss.common.logtools import *
class
Socket
(
BaseSocket
):
def
__info__
(
self
):
info_str
=
"UDP SOCKET: host={self._host} port={self._port}
\n
"
return
info_str
def
_connect
(
self
,
host
,
port
):
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
sock
.
setsockopt
(
socket
.
SOL_IP
,
socket
.
IP_TOS
,
0x10
)
...
...
doc/docs/dev_comm.md
View file @
1a770a36
...
...
@@ -208,7 +208,9 @@ Mainly for tests and debugging purpose.
#### Not declared in config
Example to use in BLISS shell.
```
yaml
```
python
from
bliss.comm.util
import
get_comm
,
TCP
conf
=
{
"tcp"
:
{
"url"
:
"trucmuch.esrf.fr"
}}
opt
=
{
"port"
:
5025
}
kom
=
get_comm
(
conf
,
ctype
=
TCP
,
**
opt
)
...
...
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