DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/samples/comms/sample_socket_ipc/README.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_ipc_socketclientserver_sample Inter-process Communication (IPC) Sample
4 
5 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 @tableofcontents
8 
9 @section dwx_ipc_socketclientserver_description Description
10 
11 The Socket Inter-process Communication (IPC) sample demonstrates
12 simple IPC functionalities using network sockets.
13 
14 @section dwx_ipc_socketclientserver_running Running the Sample
15 
16 The command line for the sample is:
17 
18  ./sample_socket_ipc_clientserver --role=[client|server]
19  --ip=[address]
20  --port=[port]
21 
22 
23 where
24 
25  --role=[client|server]
26  Is either "client" or "server" (required).
27  Default value: client
28 
29  --ip=[address]
30  Is the server IP the client connects to (optional).
31  Default value: 127.0.0.1
32 
33  --port=[port]
34  Is the port the server will listen on / the client will connect to (optional).
35  Default value: 49252
36 
37 @subsection dwx_ipc_socketclientserver_examples Examples
38 
39 Two instances of the sample are required. The server instance has to be started first.
40 
41  ./sample_socket_ipc_clientserver --role=server --port=49252
42 
43  ./sample_socket_ipc_clientserver --role=client --port=49252 --ip=127.0.0.1
44 
45 @section dwx_ipc_socketclientserver_output Output
46 
47 In the sample the client generates random values, sends them to the server, who echoes them back.
48 
49 Server:
50 
51  nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=server
52  Program Arguments:
53  --ip=127.0.0.1
54  --port=49252
55  --role=server
56 
57  [9-8-2018 16:16:56] Initialize DriveWorks SDK v1.2.227
58  [9-8-2018 16:16:56] Release build with GNU 4.9.4 from v1.2.0-rc6-0-g79beb2a against Vibrante PDK v5.0.10.3
59  [9-8-2018 16:16:56] Platform: Detected Drive PX2 - Tegra A
60  [9-8-2018 16:16:56] TimeSource: monotonic epoch time offset is 1533299678306576
61  [9-8-2018 16:16:56] TimeSource: PTP ioctl returned error. Synchronized time will not be available.
62  [9-8-2018 16:16:56] TimeSource: Could not detect valid PTP time source at 'eth0'. Fallback to CLOCK_MONOTONIC.
63  [9-8-2018 16:16:56] Platform: number of GPU devices detected 2
64  [9-8-2018 16:16:56] Platform: currently selected GPU device discrete ID 0
65  [9-8-2018 16:16:56] SDK: Resources mounted from /usr/local/driveworks-1.2/data/resources
66  [9-8-2018 16:16:56] SDK: Create NvMediaDevice
67  [9-8-2018 16:16:56] SDK: Create NvMediaIPPManager
68  [9-8-2018 16:16:56] egl::Display: found 2 EGL devices
69  [9-8-2018 16:16:56] egl::Display: use drm device: drm-nvdc
70  [9-8-2018 16:16:56] SocketServer: listening on 49252
71  [9-8-2018 16:16:58] SocketServer: accepted 127.0.0.1:40020
72  [9-8-2018 16:16:58] SocketServer: accepted 127.0.0.1:40022
73  Socket Server received 1
74  Socket Server send 1
75  Socket Server received 2
76  Socket Server send 2
77  Socket Server received 3
78  Socket Server send 3
79  Socket Server received 4
80  Socket Server send 4
81  Socket Server received 5
82  Socket Server send 5
83  [9-8-2018 16:17:2] Driveworks SDK released
84 
85 Client:
86 
87  nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=client
88  Program Arguments:
89  --ip=127.0.0.1
90  --port=49252
91  --role=client
92 
93  [9-8-2018 16:16:58] Initialize DriveWorks SDK v1.2.227
94  [9-8-2018 16:16:58] Release build with GNU 4.9.4 from v1.2.0-rc6-0-g79beb2a against Vibrante PDK v5.0.10.30
95  [9-8-2018 16:16:58] Platform: Detected Drive PX2 - Tegra A
96  [9-8-2018 16:16:56] TimeSource: monotonic epoch time offset is 1533299678306576
97  [9-8-2018 16:16:56] TimeSource: PTP ioctl returned error. Synchronized time will not be available.
98  [9-8-2018 16:16:56] TimeSource: Could not detect valid PTP time source at 'eth0'. Fallback to CLOCK_MONOTONIC.
99  [9-8-2018 16:16:56] Platform: number of GPU devices detected 2
100  [9-8-2018 16:16:56] Platform: currently selected GPU device discrete ID 0
101  [9-8-2018 16:16:56] SDK: Resources mounted from /usr/local/driveworks-1.2/data/resources
102  [9-8-2018 16:16:56] SDK: Create NvMediaDevice
103  [9-8-2018 16:16:56] SDK: Create NvMediaIPPManager
104  [9-8-2018 16:16:56] egl::Display: found 2 EGL devices
105  [9-8-2018 16:16:56] egl::Display: use drm device: drm-nvdc
106  [9-8-2018 16:16:58] SocketClient: connected 127.0.0.1:49252
107  [9-8-2018 16:16:58] SocketClient: connected 127.0.0.1:49252
108  Socket Client send 1
109  Socket Client received 1
110  Socket Client send 2
111  Socket Client received 2
112  Socket Client send 3
113  Socket Client received 3
114  Socket Client send 4
115  Socket Client received 4
116  Socket Client send 5
117  ^CSocket Client received 5
118  [9-8-2018 16:17:2] Driveworks SDK released
119 
120 @section dwx_ipc_socketclientserver_more Additional information
121 
122 For more details see @ref ipc_mainsection .