Defines an interface and common methods for sending simple messages (see simple_message). This interface makes a bare minimum of assumptions: More...
#include <smpl_msg_connection.h>
Public Member Functions | |
virtual bool | isConnected ()=0 |
return connection status More... | |
virtual bool | makeConnect ()=0 |
connects to the remote host More... | |
virtual bool | receiveMsg (industrial::simple_message::SimpleMessage &message) |
Receives a message using the data connection. More... | |
bool | sendAndReceiveMsg (industrial::simple_message::SimpleMessage &send, industrial::simple_message::SimpleMessage &recv, bool verbose=false) |
Performs a complete send and receive. This is helpful when sending a message that requires and explicit reply. More... | |
virtual bool | sendMsg (industrial::simple_message::SimpleMessage &message) |
Sends a message using the data connection. More... | |
Private Member Functions | |
virtual bool | receiveBytes (industrial::byte_array::ByteArray &buffer, industrial::shared_types::shared_int num_bytes)=0 |
Method used by receive message interface method. This should be overridden for the specific connection type. More... | |
virtual bool | sendBytes (industrial::byte_array::ByteArray &buffer)=0 |
Method used by send message interface method. This should be overridden for the specific connection type. More... | |
Defines an interface and common methods for sending simple messages (see simple_message). This interface makes a bare minimum of assumptions:
Definition at line 61 of file smpl_msg_connection.h.
|
pure virtual |
return connection status
Implemented in industrial::simple_socket::SimpleSocket.
|
pure virtual |
connects to the remote host
Implemented in industrial::tcp_client::TcpClient, industrial::tcp_server::TcpServer, industrial::udp_client::UdpClient, and industrial::udp_server::UdpServer.
|
privatepure virtual |
Method used by receive message interface method. This should be overridden for the specific connection type.
data | to receive. |
size | (in bytes) of data to receive |
Implemented in TestServer, and industrial::simple_socket::SimpleSocket.
|
virtual |
Receives a message using the data connection.
populated | with received message |
Definition at line 79 of file smpl_msg_connection.cpp.
bool industrial::smpl_msg_connection::SmplMsgConnection::sendAndReceiveMsg | ( | industrial::simple_message::SimpleMessage & | send, |
industrial::simple_message::SimpleMessage & | recv, | ||
bool | verbose = false |
||
) |
Performs a complete send and receive. This is helpful when sending a message that requires and explicit reply.
message | to send |
populated | with received message |
verbosity | level of low level logging |
Definition at line 127 of file smpl_msg_connection.cpp.
|
privatepure virtual |
Method used by send message interface method. This should be overridden for the specific connection type.
data | to send. |
Implemented in industrial::simple_socket::SimpleSocket, and TestClient.
|
virtual |
Sends a message using the data connection.
message | to send |
Definition at line 56 of file smpl_msg_connection.cpp.