#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 Attributes | |
string | hostname |
Hostname given at open. | |
bool | is_open |
Whether the socket has been opened. | |
string | port |
Port given at open. | |
const_buffer | rx_buffer |
Characters to return on calls to receive() | |
size_t | rx_count |
Number of characters requested by client by calling receive() | |
unsigned char | tx_buffer [4096] |
Characters passed in during send() | |
size_t | tx_count |
Number of characters sent via send() |
Fake socket for testing
Definition at line 44 of file test_socket.h.
eip::socket::TestSocket::TestSocket | ( | ) | [inline] |
Definition at line 67 of file test_socket.h.
eip::socket::TestSocket::TestSocket | ( | const_buffer | rbuf | ) | [inline] |
Definition at line 69 of file test_socket.h.
void eip::socket::TestSocket::clearTxBuffer | ( | ) | [inline] |
Helper to clear out the TX buffer between tests
Definition at line 119 of file test_socket.h.
virtual void eip::socket::TestSocket::close | ( | ) | [inline, virtual] |
virtual void eip::socket::TestSocket::open | ( | string | hostname, |
string | port | ||
) | [inline, virtual] |
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.
virtual size_t eip::socket::TestSocket::receive | ( | mutable_buffer | buf | ) | [inline, virtual] |
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.
virtual size_t eip::socket::TestSocket::send | ( | const_buffer | buf | ) | [inline, virtual] |
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.
Hostname given at open.
Definition at line 52 of file test_socket.h.
Whether the socket has been opened.
Definition at line 49 of file test_socket.h.
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.
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.
Number of characters sent via send()
Definition at line 60 of file test_socket.h.