forked from jojojames/PhxSocketCPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SocketDelegate.h
63 lines (56 loc) · 1.3 KB
/
SocketDelegate.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* \file SocketDelegate.h
* \brief Delegate interface classes to receive Websocket callbacks.
*
* Detailed description
*
*/
#ifndef SocketDelegate_H
#define SocketDelegate_H
#include <string>
class WebSocket;
class SocketDelegate {
public:
/**
* \brief Callback received when Websocket is connected.
*
* Detailed description
*
* \param param
* \return return type
*/
virtual void webSocketDidOpen(WebSocket* socket) = 0;
/**
* \brief Callback received when Websocket receives a message.
*
* Detailed description
*
* \param param
* \return return type
*/
virtual void webSocketDidReceive(
WebSocket* socket, const std::string& message)
= 0;
/**
* \brief Callback received when Websocket has an error.
*
* Detailed description
*
* \param param
* \return return type
*/
virtual void webSocketDidError(WebSocket* socket, const std::string& error)
= 0;
/**
* \brief Callback received when Websocket closes.
*
* Detailed description
*
* \param param
* \return return type
*/
virtual void webSocketDidClose(
WebSocket* socket, int code, const std::string& reason, bool wasClean)
= 0;
};
#endif