MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / main

Function main

DevGuideExamples/FACE/Simple/Subscriber.cpp:10–58  ·  view source on GitHub ↗

FUZZ: disable check_for_improper_main_declaration

Source from the content-addressed store, hash-verified

8
9// FUZZ: disable check_for_improper_main_declaration
10int main(int, char*[])
11{
12 // Initialize the TS interface
13 FACE::RETURN_CODE_TYPE status;
14 FACE::TS::Initialize("face_config.ini", status);
15
16 if (status != FACE::RC_NO_ERROR) {
17 return static_cast<int>(status);
18 }
19
20 // Create the sub connection
21 FACE::CONNECTION_ID_TYPE connId;
22 FACE::CONNECTION_DIRECTION_TYPE dir;
23 FACE::MESSAGE_SIZE_TYPE max_msg_size;
24 FACE::TS::Create_Connection(
25 "sub", FACE::PUB_SUB, connId, dir,
26 max_msg_size, FACE::INF_TIME_VALUE, status);
27
28 if (status != FACE::RC_NO_ERROR) {
29 return static_cast<int>(status);
30 }
31
32 // Receive a message
33 const FACE::TIMEOUT_TYPE timeout = FACE::INF_TIME_VALUE;
34 FACE::TRANSACTION_ID_TYPE txn;
35 Messenger::Message msg;
36
37 ACE_DEBUG((
38 LM_INFO, "Subscriber: about to Receive_Message()\n"));
39
40 FACE::TS::Receive_Message(
41 connId, timeout, txn, msg, max_msg_size, status);
42
43 if (status != FACE::RC_NO_ERROR) {
44 return static_cast<int>(status);
45 }
46
47 // Output the message
48 ACE_DEBUG((LM_INFO, "%C\t%d\n", msg.text.in(), msg.count));
49
50 // Destroy the sub connection
51 FACE::TS::Destroy_Connection(connId, status);
52
53 if (status != FACE::RC_NO_ERROR) {
54 return static_cast<int>(status);
55 }
56
57 return EXIT_SUCCESS;
58}
59// FUZZ: enable check_for_improper_main_declaration

Callers

nothing calls this directly

Calls 5

InitializeFunction · 0.85
Create_ConnectionFunction · 0.85
Receive_MessageFunction · 0.85
Destroy_ConnectionFunction · 0.85
inMethod · 0.45

Tested by

no test coverage detected