![]() |
PhoenixZMQ
2.0.0
Library which integrates zeromq use in Phoenix
|
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <thread>
#include "data_stream_assert.h"
#include "PGenericSocketManager.h"
Go to the source code of this file.
Typedefs | |
typedef SocketManager::Backend | Backend |
typedef SocketManager::Mock | Mock |
typedef PGenericSocketManager< std::string, PEmptyBackend, PMockBackend > | SocketManager |
Functions | |
int | main (int argc, char **argv) |
void | testMockSocket (PSocketMode::PSocketMode mode) |
Launch the process. More... | |
void | testMockSocketMessage (PSocketMode::PSocketMode mode) |
Launch the process. More... | |
void | threadRecievedData (PSocketMode::PSocketMode mode, const std::string &address, size_t nbMessage, size_t port) |
Recieved messages on socket. More... | |
void | threadRecievedMessage (PSocketMode::PSocketMode mode, const std::string &address, size_t nbMessage, size_t port) |
Recieved messages on socket. More... | |
void | threadSendData (PSocketMode::PSocketMode mode, size_t nbMessage, const std::string &address, size_t port) |
Send messages on socket. More... | |
void | threadSendMessage (PSocketMode::PSocketMode mode, size_t nbMessage, const std::string &address, size_t port) |
Send messages on socket. More... | |
typedef SocketManager::Backend Backend |
typedef SocketManager::Mock Mock |
typedef PGenericSocketManager<std::string, PEmptyBackend, PMockBackend> SocketManager |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 136 of file main.cpp.
References PSocketMode::MOCK, PSocketMode::NO_MOCK, testMockSocket(), and testMockSocketMessage().
void testMockSocket | ( | PSocketMode::PSocketMode | mode | ) |
Launch the process.
mode | : mode of the socket |
Definition at line 66 of file main.cpp.
References threadRecievedData(), and threadSendData().
Referenced by main().
void testMockSocketMessage | ( | PSocketMode::PSocketMode | mode | ) |
Launch the process.
mode | : mode of the socket |
Definition at line 129 of file main.cpp.
References threadRecievedMessage(), and threadSendMessage().
Referenced by main().
void threadRecievedData | ( | PSocketMode::PSocketMode | mode, |
const std::string & | address, | ||
size_t | nbMessage, | ||
size_t | port | ||
) |
Recieved messages on socket.
mode | : mode of the mock to be used |
address | : address of the socket |
nbMessage | : number of message to be read |
port | : connection port to be used |
Definition at line 46 of file main.cpp.
References PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::addClientSocket(), data_stream_assert, PSocketMode::NO_MOCK, and PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::recvData().
Referenced by testMockSocket().
void threadRecievedMessage | ( | PSocketMode::PSocketMode | mode, |
const std::string & | address, | ||
size_t | nbMessage, | ||
size_t | port | ||
) |
Recieved messages on socket.
mode | : mode of the mock to be used |
address | : address of the socket |
nbMessage | : number of message to be read |
port | : connection port to be used |
Definition at line 103 of file main.cpp.
References PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::addClientSocket(), data_stream_assert, PSocketMode::NO_MOCK, and PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::recvMsg().
Referenced by testMockSocketMessage().
void threadSendData | ( | PSocketMode::PSocketMode | mode, |
size_t | nbMessage, | ||
const std::string & | address, | ||
size_t | port | ||
) |
Send messages on socket.
mode | : mode of the mock to be used |
nbMessage | : number of message to be sent |
address | : address of the socket |
port | : connection port to be used |
Definition at line 28 of file main.cpp.
References PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::addServerSocket(), data_stream_assert, PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::isConnected(), and PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::sendData().
Referenced by testMockSocket().
void threadSendMessage | ( | PSocketMode::PSocketMode | mode, |
size_t | nbMessage, | ||
const std::string & | address, | ||
size_t | port | ||
) |
Send messages on socket.
mode | : mode of the mock to be used |
nbMessage | : number of message to be sent |
address | : address of the socket |
port | : connection port to be used |
Definition at line 80 of file main.cpp.
References PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::addServerSocket(), data_stream_assert, PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::isConnected(), and PGenericSocketManager< _TSocketKey, _TBackend, _TMockBackend >::sendMsg().
Referenced by testMockSocketMessage().