NetworkTransport Class
(CDP::IO::NetworkTransport)The NetworkTransport class provides base functionality for UDPTransport and TCPTransport. It handles the following properties as read from the configuration: More...
Header: | #include <IO/NetworkTransport.h> |
Inherits: | Transport |
Inherited By: |
Public Functions
NetworkTransport(const std::function<unsigned int( Transport *, char *, unsigned int ) > readCallbackHandler) | |
const IpAddress & | LocalIP() const |
void | OpenSucceeded() |
const IpAddress & | RemoteIP() const |
Reimplemented Public Functions
virtual void | Close() override |
virtual void | Configure(XMLElementEx *element, CDPComponent *owner) |
virtual void | FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const override |
virtual const std::string | GetNodeName() const override |
virtual std::string | GetNodeTypeName() const override |
virtual double | GetTimeout() const |
virtual bool | Open(OpenMode mode) override |
- 12 public functions inherited from CDP::IO::Transport
- 26 public functions inherited from CDP::StudioAPI::CDPNode
- 22 public functions inherited from CDP::StudioAPI::ICDPNode
Additional Inherited Members
- 1 static public member inherited from CDP::IO::Transport
- 1 protected function inherited from CDP::StudioAPI::CDPNode
Detailed Description
The NetworkTransport class provides base functionality for UDPTransport and TCPTransport. It handles the following properties as read from the configuration:
Name | Description |
---|---|
Name | The transport instance name |
LocalName | The Name of the ethernet interface as defined in Application configuration (f.i. 'ETH0') |
ListenPort | The port to listen for incoming data on |
RemoteIP | The remote IP address to communicate with |
RemotePort | The port on the remote side to communicate with |
Timeout | The (default) timeout in seconds to use when performing Read() and Write() functions on this transport |
Model | the Model name of the Transport |
See also Transport, UDPTransport, and TCPTransport.
Member Function Documentation
NetworkTransport::NetworkTransport(const std::function<unsigned int( Transport *, char *, unsigned int ) > readCallbackHandler)
Network Transport constructor
[override virtual]
void NetworkTransport::Close()
[virtual]
void NetworkTransport::Configure(XMLElementEx *element, CDPComponent *owner)
Reimplemented from Transport::Configure().
Configures the NetworkTransport from the following XML configuration:
<NetworkInterface Name="ETH" LocalName="ETH0" ListenPort="4000" RemoteIP="127.0.0.1" RemotePort="5000"/>
Parameter element is a pointer to the <NetworkInterface> XML element, while owner is the Component that the object resides in.
[override virtual]
void NetworkTransport::FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const
Reimplemented from CDPNode::FillNodeChildren().
Serializes the transport
[override virtual]
const std::string NetworkTransport::GetNodeName() const
Reimplemented from ICDPNode::GetNodeName().
Returns the configured name
[override virtual]
std::string NetworkTransport::GetNodeTypeName() const
Reimplemented from ICDPNode::GetNodeTypeName().
Returns "NetworkTransport"
[virtual]
double NetworkTransport::GetTimeout() const
Reimplemented from Transport::GetTimeout().
Returns the content of the Timeout attribute in the NetworkTransport configuration
const IpAddress &NetworkTransport::LocalIP() const
Returns the local IpAddress (with the port set to listenPort)
[override virtual]
bool NetworkTransport::Open(OpenMode mode)
void NetworkTransport::OpenSucceeded()
const IpAddress &NetworkTransport::RemoteIP() const
Returns the remote IpAddress (with the port set to remotePort)
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.