1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page dwx_ipc_socketclientserver_sample Inter-process Communication (IPC) Sample
7 @section dwx_ipc_socketclientserver_description Description
9 The Socket Inter-process Communication (IPC) sample demonstrates
10 simple IPC functionalities using network sockets.
12 @section dwx_ipc_socketclientserver_running Running the Sample
14 The command line for the sample is:
16 ./sample_socket_ipc_clientserver --role=[client|server]
23 --role=[client|server]
24 Is either "client" or "server" (required).
28 Is the server IP the client connects to (optional).
29 Default value: 127.0.0.1
32 Is the port the server will listen on / the client will connect to (optional).
35 @subsection dwx_ipc_socketclientserver_examples Examples
37 Two instances of the sample are required. The server instance has to be started first.
39 ./sample_socket_ipc_clientserver --role=server --port=49252
41 ./sample_socket_ipc_clientserver --role=client --port=49252 --ip=127.0.0.1
43 @section dwx_ipc_socketclientserver_output Output
45 In the sample the client generates random values, sends them to the server, who echoes them back.
49 nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=server
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
73 Socket Server received 2
75 Socket Server received 3
77 Socket Server received 4
79 Socket Server received 5
81 [9-8-2018 16:17:2] Driveworks SDK released
85 nvidia@tegra-ubuntu:/usr/local/driveworks-1.2/bin$ ./sample_socket_ipc_clientserver --role=client
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
107 Socket Client received 1
109 Socket Client received 2
111 Socket Client received 3
113 Socket Client received 4
115 ^CSocket Client received 5
116 [9-8-2018 16:17:2] Driveworks SDK released
118 @section dwx_ipc_socketclientserver_more Additional information
120 For more details see @ref ipc_mainsection .