Newer
Older
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/***************************************
Auteur : Pierre Aubert
Mail : pierre.aubert@lapp.in2p3.fr
Licence : CeCILL-C
****************************************/
#include "PEmptyBackend.h"
///Default constructor of PEmptyBackend
PEmptyBackend::PEmptyBackend(){
}
///Create param for a client socket
/** @param address : address of the server to be connected to
* @param port : port to be used
* @return corresponding PZmqParam
*/
PEmptyBackend::Param PEmptyBackend::client(const std::string & address, size_t port){
PEmptyBackend::Param param;
param.address = address;
param.port = port;
return param;
}
///Create param for a server socket
/** @param address : address of the server to be connected to
* @param port : port to be used
* @return corresponding PZmqParam
*/
PEmptyBackend::Param PEmptyBackend::server(const std::string & address, size_t port){
return PEmptyBackend::client(address, port);
}
///Create a client socket
/** @param[out] socket : socket to be created
* @param address : address of the server, the client has to connect to
* @param port : port to be used for the connection
* @param param : extra customisable parameters for the creation of the socket (depends on the backend)
* @return true if the socket has been created, false otherwise
*/
bool PEmptyBackend::createClientSocket(PEmptyBackend::Socket & socket, const std::string & address, size_t port, const PEmptyParam & param){
return true;
}
///Create a client socket
/** @param[out] socket : socket to be created
* @param address : address of the server, the client has to connect to
* @param port : port to be used for the connection
* @param param : extra customisable parameters for the creation of the socket (depends on the backend)
* @return true if the socket has been created, false otherwise
*/
bool PEmptyBackend::createServerSocket(PEmptyBackend::Socket & socket, const std::string & address, size_t port, const PEmptyParam & param){
return true;
}
///Create a client socket
/** @param[out] socket : socket to be created
* @param param : extra customisable parameters for the creation of the socket (depends on the backend)
* @return true if the socket has been created, false otherwise
*/
bool PEmptyBackend::createClientSocket(PEmptyBackend::Socket & socket, const PEmptyParam & param){
return true;
}
///Create a client socket
/** @param[out] socket : socket to be created
* @param param : extra customisable parameters for the creation of the socket (depends on the backend)
* @return true if the socket has been created, false otherwise
*/
bool PEmptyBackend::createServerSocket(PEmptyBackend::Socket & socket, const PEmptyParam & param){
return true;
}
///Send message on the given socket
/** @param socket : socket to be used
* @param msg : message to be sent
* @param flags : flags to be used to send the message (none, dontwait, sndmore, etc)
* @return true on success, false otherwise
*/
bool PEmptyBackend::send(PEmptyBackend::Socket & socket, const PEmptyBackend::Message & msg, int flags){
return true;
}
///Recieve message from the given socket
/** @param socket : socket to be used
* @param msg : message to be recieved
* @param flags : flags to be used to send the message (none, dontwait, sndmore, etc)
* @return true on success, false otherwise
*/
bool PEmptyBackend::recv(PEmptyBackend::Socket & socket, PEmptyBackend::Message & msg, int flags){
return false;
}
///Resize a message
/** @param[out] msg : message to be resized
* @param sizeMsg : new size of the message
*/
void PEmptyBackend::msgResize(PEmptyBackend::Message& msg, size_t sizeMsg){
msg.resize(sizeMsg);
}
///Get the size of a message
/** @param msg : message to be used
* @return size of the message in bytes
*/
size_t PEmptyBackend::msgSize(const PEmptyBackend::Message& msg){
return msg.size();
}
///Get the data of a message
/** @param msg : message to be used
* @return data of the message in bytes
*/
const char* PEmptyBackend::msgData(const PEmptyBackend::Message& msg){
return msg.data();
}
///Get the data of a message
/** @param msg : message to be used
* @return data of the message in bytes
*/
char* PEmptyBackend::msgData(PEmptyBackend::Message& msg){
return msg.data();
}
///Close the given socket
/** @param[out] socket : socket to be closed
*/
void PEmptyBackend::close(PEmptyBackend::Socket & socket){
}
///Close the given socket
/** @param socket : socket to be checked
* @return true if the socket is connected, false otherwise
*/
bool PEmptyBackend::isConnected(const PEmptyBackend::Socket & socket){
return true;
}