Public Member Functions | List of all members
eip::socket::Socket Class Referenceabstract

#include <socket.h>

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

Public Member Functions

virtual void close ()=0
 
virtual void open (string hostname, string port)=0
 
virtual size_t receive (mutable_buffer buf)=0
 
virtual size_t send (const Serializable &msg)
 
virtual size_t send (const_buffer buf)=0
 
virtual ~Socket ()
 

Detailed Description

Generic interface for sockets. Provides the ability to produce testable implementations that don't rely on actual sockets.

Definition at line 58 of file socket.h.

Constructor & Destructor Documentation

◆ ~Socket()

virtual eip::socket::Socket::~Socket ( )
inlinevirtual

Definition at line 62 of file socket.h.

Member Function Documentation

◆ close()

virtual void eip::socket::Socket::close ( )
pure virtual

◆ open()

virtual void eip::socket::Socket::open ( string  hostname,
string  port 
)
pure 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

Implemented in eip::socket::TestSocket, eip::socket::UDPSocket, and eip::socket::TCPSocket.

◆ receive()

virtual size_t eip::socket::Socket::receive ( mutable_buffer  buf)
pure virtual

Receive bytes from the socket

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

Implemented in eip::socket::TestSocket, eip::socket::UDPSocket, and eip::socket::TCPSocket.

◆ send() [1/2]

virtual size_t eip::socket::Socket::send ( const Serializable msg)
inlinevirtual

Send the serializable message out the socket

Parameters
msgSerializable message to send
Returns
number of bytes sent

Definition at line 88 of file socket.h.

◆ send() [2/2]

virtual size_t eip::socket::Socket::send ( const_buffer  buf)
pure virtual

Send the contents of the buffer out the socket

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

Implemented in eip::socket::TestSocket, eip::socket::UDPSocket, and eip::socket::TCPSocket.


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


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Wed Mar 2 2022 00:38:56