1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page dwx_ipc_socketclientserver_sample Inter-process Communication (IPC) Sample
5 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
9 @section dwx_ipc_socketclientserver_description Description
11 The Socket Inter-process Communication (IPC) sample demonstrates
12 simple IPC functionalities using network sockets.
14 @section dwx_ipc_socketclientserver_running Running the Sample
16 The command line for the sample is:
18 ./sample_socket_ipc_clientserver --role=[client|server]
25 --role=[client|server]
26 Is either "client" or "server" (required).
30 Is the server IP the client connects to (optional).
31 Default value: 127.0.0.1
34 Is the port the server will listen on / the client will connect to (optional).
37 @subsection dwx_ipc_socketclientserver_examples Examples
39 Two instances of the sample are required. The server instance has to be started first.
41 ./sample_socket_ipc_clientserver --role=server --port=49252
43 ./sample_socket_ipc_clientserver --role=client --port=49252 --ip=127.0.0.1
45 @section dwx_ipc_socketclientserver_output Output
47 In the sample the client generates random values, sends them to the server, who echoes them back.
51 nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=server
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
75 Socket Server received 2
77 Socket Server received 3
79 Socket Server received 4
81 Socket Server received 5
83 [9-8-2018 16:17:2] Driveworks SDK released
87 nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=client
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
109 Socket Client received 1
111 Socket Client received 2
113 Socket Client received 3
115 Socket Client received 4
117 ^CSocket Client received 5
118 [9-8-2018 16:17:2] Driveworks SDK released
120 @section dwx_ipc_socketclientserver_more Additional information
122 For more details see @ref ipc_mainsection .