Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
D0020E-projekt
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
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
Henrik Tjäder
D0020E-projekt
Commits
9e20b3c2
Commit
9e20b3c2
authored
10 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Added locality placeholder function
parent
4dee57d5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
UDP-client-server.py
+18
-1
18 additions, 1 deletion
UDP-client-server.py
with
18 additions
and
1 deletion
UDP-client-server.py
+
18
−
1
View file @
9e20b3c2
...
...
@@ -6,6 +6,11 @@ from threading import Thread, Timer
import
numpy
as
np
from
array
import
*
# pymongo for MongoDB support
import
pymongo
# For timestamping in MongoDB
import
datetime
#DEFINE INPUTS HERE
#CLIENT - SENDER
...
...
@@ -86,7 +91,7 @@ def udp_client_receive(UDP_RECEIVE_IP, UDP_RECEIVE_PORT):
outfile
.
close
()
#
CALLBACK FUNCTION
#
DATA SUBSCRIPTION (callback)
def
cb_event
(
recipient
,
threshold
):
# TODO
...
...
@@ -98,6 +103,15 @@ def cb_event(recipient, threshold):
# any of the thresholds are exceeded. Notify recpient as needed.
print
(
"
TODO
"
)
#GET LOCALITY
def
get_loc
():
# Query locality group, return the bounding box for current loc
#TODO
loc
=
0
return
loc
#CLIENT SERVER SIDE
def
udp_client_send
(
UDP_DEST_IP
,
UDP_DEST_PORT
,
PACKET_SIZE
,
NR_OF_PACKETS
,
PACKETS_PER_SEC
):
...
...
@@ -232,6 +246,9 @@ if __name__ == "__main__":
while
sender_thread
.
is_alive
():
time
.
sleep
(
1
)
# Measurement done, store data and then move on
# While testing, end after one iteration
sys
.
exit
()
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