-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed server on restart changing 0mq mechanism in PUB-SUB
- Loading branch information
1 parent
5c77bc2
commit 2f9ee4d
Showing
9 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.7' | ||
|
||
services: | ||
|
||
test-latency: | ||
image: iitschri/hidman:latest | ||
|
||
command: python3 /usr/local/src/hidman/apps/python-examples/latency_test.py | ||
|
||
privileged: true | ||
stdin_open: true | ||
tty: true | ||
network_mode: host | ||
|
||
volumes: | ||
- type: bind | ||
source: ../ | ||
target: /usr/local/src/hidman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from hidman.core import HIDClient | ||
|
||
|
||
dev = HIDClient(address="tcp://localhost:6666") | ||
|
||
print(dev.waitKey()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import threading | ||
import time | ||
import statistics | ||
|
||
from hidman.core import HIDServer, HIDClient | ||
|
||
serv = HIDServer(address="tcp://*:6666") | ||
t = threading.Thread(target=serv.run) | ||
t.start() | ||
client = HIDClient(address="tcp://localhost:6666") | ||
trials = [] | ||
for i in range(0,5000): | ||
trials.append(client.waitEvent()[1]) | ||
print("Latency mean=%.6f std=%.6f" % (statistics.mean(trials), statistics.stdev(trials)) ) | ||
serv.close() | ||
t.join() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
__authors__ = 'Davide De Tommaso' | ||
__emails__ = '[email protected]' | ||
__license__ = 'MIT' | ||
__version__ = '0.6' | ||
__version__ = '0.7' | ||
__description__ = 'A Python based HID (Human Interface Device) events manager' | ||
__requirements__ = ['pytest>=6.2.4', 'evdev>=1.4.0', 'pyzmq>=22.1.0'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters