#include <test_socket.h>
Public Member Functions | |
void | clearTxBuffer () |
virtual void | close () |
virtual void | open (string hostname, string port) |
virtual size_t | receive (mutable_buffer buf) |
virtual size_t | send (const_buffer buf) |
TestSocket () | |
TestSocket (const_buffer rbuf) | |
Public Member Functions inherited from eip::socket::Socket | |
virtual size_t | send (const Serializable &msg) |
virtual | ~Socket () |
Public Attributes | |
string | hostname |
Hostname given at open. More... | |
bool | is_open |
Whether the socket has been opened. More... | |
string | port |
Port given at open. More... | |
const_buffer | rx_buffer |
Characters to return on calls to receive() More... | |
size_t | rx_count |
Number of characters requested by client by calling receive() More... | |
unsigned char | tx_buffer [4096] |
Characters passed in during send() More... | |
size_t | tx_count |
Number of characters sent via send() More... | |
Fake socket for testing
Definition at line 44 of file test_socket.h.
|
inline |
Definition at line 67 of file test_socket.h.
|
inline |
Definition at line 69 of file test_socket.h.
|
inline |
Helper to clear out the TX buffer between tests
Definition at line 119 of file test_socket.h.
|
inlinevirtual |
|
inlinevirtual |
Open the socket to connect to the given hostname and port
hostname | Hostname to connect to |
port | Name or number of port to connect to |
Implements eip::socket::Socket.
Definition at line 76 of file test_socket.h.
|
inlinevirtual |
Receive bytes from the socket
buf | Buffer into which to store received data |
Implements eip::socket::Socket.
Definition at line 108 of file test_socket.h.
|
inlinevirtual |
Send the contents of the buffer out the socket
buf | Data to send out the socket |
Implements eip::socket::Socket.
Definition at line 96 of file test_socket.h.
string eip::socket::TestSocket::hostname |
Hostname given at open.
Definition at line 52 of file test_socket.h.
bool eip::socket::TestSocket::is_open |
Whether the socket has been opened.
Definition at line 49 of file test_socket.h.
string eip::socket::TestSocket::port |
Port given at open.
Definition at line 55 of file test_socket.h.
const_buffer eip::socket::TestSocket::rx_buffer |
Characters to return on calls to receive()
Definition at line 63 of file test_socket.h.
size_t eip::socket::TestSocket::rx_count |
Number of characters requested by client by calling receive()
Definition at line 65 of file test_socket.h.
unsigned char eip::socket::TestSocket::tx_buffer[4096] |
Characters passed in during send()
Definition at line 58 of file test_socket.h.
size_t eip::socket::TestSocket::tx_count |
Number of characters sent via send()
Definition at line 60 of file test_socket.h.