Branch data Line data Source code
1 : : /*
2 : : * Copyright 2006-2008 Savarese Software Research Corporation
3 : : *
4 : : * Licensed under the Apache License, Version 2.0 (the "License");
5 : : * you may not use this file except in compliance with the License.
6 : : * You may obtain a copy of the License at
7 : : *
8 : : * http://www.savarese.com/software/ApacheLicense-2.0
9 : : *
10 : : * Unless required by applicable law or agreed to in writing, software
11 : : * distributed under the License is distributed on an "AS IS" BASIS,
12 : : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 : : * See the License for the specific language governing permissions and
14 : : * limitations under the License.
15 : : */
16 : :
17 : : #ifndef __WISP_EXAMPLE_ECHO_PROTOCOL_H
18 : : #define __WISP_EXAMPLE_ECHO_PROTOCOL_H
19 : :
20 : : #include <ssrc/wisp/protocol.h>
21 : :
22 : : using std::string;
23 : :
24 : : enum ProtocolNumber {
25 : : Echo = 2038
26 : : };
27 : :
28 : 18 : WISP_DEFINE_PROTOCOL(Echo);
29 : :
30 : : struct EchoProtocol : public ssrc::wisp::protocol::ServiceProtocol<Echo> {
31 : : enum MessageType {
32 : : Stop, EchoRequest, EchoReply
33 : : };
34 : :
35 : : typedef MessageEcho<Stop> MessageStop;
36 : :
37 : 18 : WISP_PROTOCOL_MESSAGE(EchoRequest, MessageEcho, ((string, payload)));
38 : 18 : WISP_PROTOCOL_MESSAGE(EchoReply, MessageEcho, ((string, payload)));
39 : :
40 : : WISP_ONE_WAY_CALL(caller_type, Stop);
41 : : WISP_TWO_WAY_CALL(caller_type, EchoRequest, EchoReply);
42 : : WISP_ONE_WAY_CALL(caller_type, EchoReply);
43 : : };
44 : :
45 : : #endif
|