DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

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