blob: 90a7f51a215c0de74af820819c2bb135fea05a27 [file] [log] [blame]
E. Scott Daniels3a2533f2020-04-22 12:40:27 -04001.if false
2==================================================================================
3 Copyright (c) 2020 Nokia
4 Copyright (c) 2020 AT&T Intellectual Property.
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18.fi
19
20&h2(Callback Receiver)
21This sample programme implements a simple message listener which
22registers three callback functions to process two specific
23message types and a default callback to handle unrecognised messages.
24
25&space
26When a message of type 1 is received, it will send two response messages
27back to the sender.
28Two messages are sent in order to illustrate that it is possible to
29send multiple responses using the same received message.
30
31&space
32The programme illustrates how multiple listening threads can be
33used, but the programme is &bold(not) thread safe; to keep
34this example as simple as possible, the counters
35are not locked when incremented.
36
37&space
38&indent
39.** pull in the code from the example directory
40&ex_start
41.im j=start-example ../../../examples/xapp_t1.cpp
42&ex_end
43&figure( Simple callback application. )
44&uindent
45&space