Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
b2a66424
Commit
b2a66424
authored
May 11, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments at the beginning of client and server files
parent
702faf9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
packet-exchange/src/client.c
packet-exchange/src/client.c
+15
-3
packet-exchange/src/server.c
packet-exchange/src/server.c
+13
-2
No files found.
packet-exchange/src/client.c
View file @
b2a66424
#define _GNU_SOURCE
/*
* Real time packet sending thread
*
* Bash options:
*
* -a Run the real time thread on CPU1
* -i USEC Wake up the real time thread every USEC microseconds
* -l N Wake up the real time thread N times
* -p PRIO Run the real time thread at priority PRIO
* -r USEC Refresh the non real time main thread every USEC microseconds
*
*/
#include <errno.h>
#include <error.h>
#include <pthread.h>
...
...
@@ -13,6 +23,8 @@
#include "send_packet.h"
#define _GNU_SOURCE
#define CLOCK_ID CLOCK_MONOTONIC
#define NSEC_PER_SEC UINT64_C(1000000000)
...
...
@@ -46,7 +58,7 @@ static void *packet_sending_thread(void *p) {
thread_param_t
*
param
=
(
thread_param_t
*
)
p
;
cpu_set_t
mask
;
if
(
param
->
enable_affinity
)
{
if
(
param
->
enable_affinity
)
{
// Set thread CPU affinity
CPU_ZERO
(
&
mask
);
CPU_SET
(
1
,
&
mask
);
...
...
packet-exchange/src/server.c
View file @
b2a66424
#define _GNU_SOURCE
/*
* Real time packet receiving thread
*
* Bash options:
*
* -a Run the real time thread on CPU1
* -p PRIO Run the real time thread at priority PRIO
* -r USEC Refresh the non real time main thread every USEC microseconds
*
*/
#include <arpa/inet.h>
#include <errno.h>
...
...
@@ -17,6 +26,8 @@
#include <time.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NSEC_PER_SEC UINT64_C(1000000000)
#define SERVER_PORT "50000"
...
...
@@ -69,7 +80,7 @@ static void *packet_receiving_thread(void *p) {
stats
->
min_interval
=
UINT64_MAX
;
stats
->
max_interval
=
0
;
if
(
param
->
enable_affinity
)
{
if
(
param
->
enable_affinity
)
{
// Set thread CPU affinity
CPU_ZERO
(
&
mask
);
CPU_SET
(
1
,
&
mask
);
...
...
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