#include <TCP.h>
Public Member Functions | |
int | connectOnce () |
int | connectOnce () |
int | read (void *data, unsigned int size) |
reads data with given size from socket | |
int | read (void *data, unsigned int size) |
reads data with given size from socket | |
int | read (void *data, unsigned int size, unsigned int delay_us) |
return after given delay with -1 else 0 and blocks endless (wait for new connection) whenn connection is broken | |
int | read (void *data, unsigned int size, unsigned int delay_us) |
return after given delay with -1 else 0 and blocks endless (wait for new connection) whenn connection is broken | |
int | readAll (void *data, unsigned int size) |
reads data with given size from socket | |
int | readAll (void *data, unsigned int size) |
reads data with given size from socket | |
TCP (unsigned int port) | |
TCP (unsigned int port) | |
TCP (std::string ip, unsigned int port) | |
TCP (std::string ip, unsigned int port) | |
int | write (void *data, unsigned int size) |
int | write (void *data, unsigned int size) |
virtual | ~TCP () |
virtual | ~TCP () |
Private Types | |
enum | _mode { server, client, server, client } |
enum | _mode { server, client, server, client } |
Private Member Functions | |
void | read_callback (bool &data_available, boost::asio::deadline_timer &timeout, const boost::system::error_code &error, std::size_t bytes_transferred) |
callback function for reading asynchron serial data with timeout | |
void | read_callback (bool &data_available, boost::asio::deadline_timer &timeout, const boost::system::error_code &error, std::size_t bytes_transferred) |
void | wait_callback (boost::asio::ip::tcp::socket &ser_port, const boost::system::error_code &error) |
void | wait_callback (boost::asio::ip::tcp::socket &ser_port, const boost::system::error_code &error) |
Private Attributes | |
_mode | _choosenMode |
unsigned int | _delay |
boost::asio::io_service | _ioService |
std::string | _ip |
unsigned int | _port |
bool | _requestNewConnection |
tcp::acceptor * | _server |
boost::asio::ip::tcp::socket * | _socket |
boost::asio::ip::tcp::endpoint * | _targetServer |
boost::asio::deadline_timer * | _timer |
Definition at line 29 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
enum apps::TCP::_mode [private] |
Definition at line 33 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
enum apps::TCP::_mode [private] |
Definition at line 33 of file src/TCP/TCP.h.
apps::TCP::TCP | ( | unsigned int | port | ) |
Definition at line 15 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
apps::TCP::TCP | ( | std::string | ip, |
unsigned int | port | ||
) |
Definition at line 32 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
apps::TCP::~TCP | ( | ) | [virtual] |
Definition at line 50 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
apps::TCP::TCP | ( | unsigned int | port | ) |
apps::TCP::TCP | ( | std::string | ip, |
unsigned int | port | ||
) |
virtual apps::TCP::~TCP | ( | ) | [virtual] |
int apps::TCP::connectOnce | ( | ) |
Definition at line 138 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::connectOnce | ( | ) |
int apps::TCP::read | ( | void * | data, |
unsigned int | size | ||
) |
reads data with given size from socket
[in,out] | arg | -> description todo |
Definition at line 58 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::read | ( | void * | data, |
unsigned int | size | ||
) |
reads data with given size from socket
[in,out] | arg | -> description todo |
int apps::TCP::read | ( | void * | data, |
unsigned int | size, | ||
unsigned int | delay_us | ||
) |
return after given delay with -1 else 0 and blocks endless (wait for new connection) whenn connection is broken
[in,out] | arg | -> description |
Definition at line 96 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::read | ( | void * | data, |
unsigned int | size, | ||
unsigned int | delay_us | ||
) |
return after given delay with -1 else 0 and blocks endless (wait for new connection) whenn connection is broken
[in,out] | arg | -> description |
apps::TCP::read_callback | ( | bool & | data_available, |
boost::asio::deadline_timer & | timeout, | ||
const boost::system::error_code & | error, | ||
std::size_t | bytes_transferred | ||
) | [private] |
callback function for reading asynchron serial data with timeout
[in,out] |
Definition at line 184 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
void apps::TCP::read_callback | ( | bool & | data_available, |
boost::asio::deadline_timer & | timeout, | ||
const boost::system::error_code & | error, | ||
std::size_t | bytes_transferred | ||
) | [private] |
int apps::TCP::readAll | ( | void * | data, |
unsigned int | size | ||
) |
reads data with given size from socket
[in,out] | arg | -> description |
Definition at line 73 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::readAll | ( | void * | data, |
unsigned int | size | ||
) |
reads data with given size from socket
[in,out] | arg | -> description |
void apps::TCP::wait_callback | ( | boost::asio::ip::tcp::socket & | ser_port, |
const boost::system::error_code & | error | ||
) | [private] |
void apps::TCP::wait_callback | ( | boost::asio::ip::tcp::socket & | ser_port, |
const boost::system::error_code & | error | ||
) | [private] |
Definition at line 205 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::write | ( | void * | data, |
unsigned int | size | ||
) |
Definition at line 167 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.cpp.
int apps::TCP::write | ( | void * | data, |
unsigned int | size | ||
) |
_mode apps::TCP::_choosenMode [private] |
Definition at line 34 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
unsigned int apps::TCP::_delay [private] |
Definition at line 36 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
boost::asio::io_service apps::TCP::_ioService [private] |
Definition at line 40 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
std::string apps::TCP::_ip [private] |
Definition at line 42 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
unsigned int apps::TCP::_port [private] |
Definition at line 41 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
bool apps::TCP::_requestNewConnection [private] |
Definition at line 38 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
tcp::acceptor * apps::TCP::_server [private] |
Definition at line 48 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
boost::asio::ip::tcp::socket * apps::TCP::_socket [private] |
Definition at line 46 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
boost::asio::ip::tcp::endpoint * apps::TCP::_targetServer [private] |
Definition at line 44 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.
boost::asio::deadline_timer * apps::TCP::_timer [private] |
Definition at line 51 of file firmware/src/VrMagicHandler_camhost/TCP/TCP.h.