Public Member Functions | Public Attributes
eip::socket::TestSocket Class Reference

#include <test_socket.h>

Inheritance diagram for eip::socket::TestSocket:
Inheritance graph
[legend]

List of all members.

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()

Detailed Description

Fake socket for testing

Definition at line 44 of file test_socket.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

Close the socket

Implements eip::socket::Socket.

Definition at line 86 of file test_socket.h.

virtual void eip::socket::TestSocket::open ( string  hostname,
string  port 
) [inline, virtual]

Open the socket to connect to the given hostname and port

Parameters:
hostnameHostname to connect to
portName 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

Parameters:
bufBuffer into which to store received data
Returns:
number of bytes read

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

Parameters:
bufData to send out the socket
Returns:
number of bytes written

Implements eip::socket::Socket.

Definition at line 96 of file test_socket.h.


Member Data Documentation

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.

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.

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.


The documentation for this class was generated from the following file:


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Sat Jun 8 2019 20:21:23