File: example-comms_socket_example.md

package info (click to toggle)
mrpt 1%3A2.5.8%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 87,448 kB
  • sloc: cpp: 551,662; ansic: 38,702; xml: 3,914; python: 2,547; sh: 404; makefile: 237
file content (29 lines) | stat: -rw-r--r-- 1,069 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
\page comms_socket_example Example: comms_socket_example

Example output:

~~~~~~~~~~~~~
[Server] Started
[00:27:20.8565|DEBUG|CServerTCPSocket] [CServerTCPSocket] Listening at 127.0.0.1:15000
[00:27:20.8566|DEBUG|CServerTCPSocket] [CServerTCPSocket::accept] Waiting incoming connections
[Client] Connecting
[Client] Connected. Waiting for a message...
[00:27:20.8766|DEBUG|CServerTCPSocket] [CServerTCPSocket::accept] Incoming connection accepted
[00:27:20.8767|DEBUG|CServerTCPSocket] [CServerTCPSocket::accept] Connection accepted from 127.0.0.1:40794
[Server] Connection accepted
[Client] Message received OK!:
  MSG Type: 16
  MSG Length: 119 bytes
[Client] Parsing payload...
[Client] Received payload: [1.000000 2.000000 3.000000 11.459156 22.918312 34.377468]
[Client] tx payload: [1.000000 2.000000 3.000000 11.459156 22.918312 34.377468]
[Client] Done!!
[Client] Finish
~~~~~~~~~~~~~

Contents of `comms_socket_example/SocketsTest_impl.cpp`:

\include comms_socket_example/SocketsTest_impl.cpp

C++ example source code:
\include comms_socket_example/test.cpp