• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • NetworkTransport
  • 4.11.14

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:

CDP::IO::TCPTransport and CDP::IO::UDPTransport

  • List of all members, including inherited members

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:

NameDescription
NameThe transport instance name
LocalNameThe Name of the ethernet interface as defined in Application configuration (f.i. 'ETH0')
ListenPortThe port to listen for incoming data on
RemoteIPThe remote IP address to communicate with
RemotePortThe port on the remote side to communicate with
TimeoutThe (default) timeout in seconds to use when performing Read() and Write() functions on this transport
Modelthe 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)

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

    © Copyright 2022 CDP Technologies. Privacy and cookie policy.

    Return to top