• 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

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • ApplicationConnector
  • 5.0.0

ApplicationConnector Class

Connected application list item with message sending capability. This class is used by Messenger. More...

Header: #include <ApplicationConnector>
  • List of all members, including inherited members

Public Functions

ApplicationConnector()
virtual ~ApplicationConnector()
int CDPversion_Major() const
int CDPversion_Minor() const
void Clear()
double GetBlockingTimer()
double GetMaxBlockingTimer()
unsigned int GetNodeID() const
const std::string GetNodeName() const
void Init(const char *name, const IpAddress &ipRemote, const IpAddress &ipLocal, int _appHandle, unsigned short brPort, const IpAddress &ipStudioAPI, int CDPversionMajor, int CDPversionMinor)
IpAddress &Ip()
IpAddress &IpLocal()
bool IsFree() const
bool IsNodeLocal() const
bool IsSendReady(int timeout)
unsigned short LargestBroadcastPort() const
bool Matches(unsigned int ipAddress1, unsigned short port1)
char *Name()
void ResetMaxBlockingTimer()
bool ResetTimeoutAndUpdateSendFlag()
int SendBroadcastMessage(MessageTransportPacket *message)
int SendMessage(MessageTransportPacket *message)
void SetName(const char *name)
void SetStudioAPIIpAddress(const IpAddress &addr)
const IpAddress &StudioAPIIpAddress() const
bool Timeout()
bool VerifyIPAddress(int32_t otherAppIpAddress, unsigned short _port)

Static Public Members

void CloseStaticSendSockets()

Detailed Description

Connected application list item with message sending capability. This class is used by Messenger.

See also Messenger.

Member Function Documentation

ApplicationConnector::ApplicationConnector()

Default constructs an instance of ApplicationConnector.

[virtual] ApplicationConnector::~ApplicationConnector()

Destroys the instance of ApplicationConnector. The destructor is virtual.

int ApplicationConnector::CDPversion_Major() const

Returns the CDP version major number

int ApplicationConnector::CDPversion_Minor() const

Returns the CDP version minor number

void ApplicationConnector::Clear()

Close connection to remote application.

[static] void ApplicationConnector::CloseStaticSendSockets()

Will call Close() on udpSend and udpBroadcast. Called from Messenger::Destroy().

double ApplicationConnector::GetBlockingTimer()

Get the last measured BlockingTimeout.

double ApplicationConnector::GetMaxBlockingTimer()

Get the last max BlockingTimeout.

[s] dMaxBlockingTimer filtered like this: no filtereng when value increases, decreasing with 1% of difference when value decreases.

Returns the time of the highest blocking time since last ResetMaxBlockingTimner [s].

unsigned int ApplicationConnector::GetNodeID() const

Returns the application handle

const std::string ApplicationConnector::GetNodeName() const

Returns the name of the application

void ApplicationConnector::Init(const char *name, const IpAddress &ipRemote, const IpAddress &ipLocal, int _appHandle, unsigned short brPort, const IpAddress &ipStudioAPI, int CDPversionMajor, int CDPversionMinor)

Initialise remote application connection.

Parameter name (char*)Remote name.
Parameter ipRemote (const IpAddress&)Remote ip address.
Parameter ipLocal (const IpAddress&)Local ip address. Identifies which adapter which should be used as sender. Important for VPN solutions.
Parameter _appHandle (int)The application unique handle.
Parameter brPort (unsigned short)Remote largest broadcast port used.
Parameter ipStudioAPI (const IpAddress&)Remote StudioAPI's IP Address (and Port).
Parameter CDPversionMajor (int)Remote CDP_VERSION_MAJOR (value 2 if unknown).
Parameter CDPversionMinor (int)Remote CDP_VERSION_MINOR (value 3 if unknown).
Parameter ownerNode (CDP::StudioAPI::ICDPNode*)Owner (pointer to Messenger instance).

IpAddress &ApplicationConnector::Ip()

Returns ApplicationConnector's ipRemote.

IpAddress contain both address and port information for remote application.

IpAddress &ApplicationConnector::IpLocal()

Returns ApplicationConnector's ipLocal. IpAddress contain both address and port information for local application.

bool ApplicationConnector::IsFree() const

Returns true if this ApplicationConnector is unused.

bool ApplicationConnector::IsNodeLocal() const

bool ApplicationConnector::IsSendReady(int timeout)

Determines if regular packet send socket can be written to. Returns false if not.

unsigned short ApplicationConnector::LargestBroadcastPort() const

Returns ApplicationConnector's remote largest broadcast portnumber used.

bool ApplicationConnector::Matches(unsigned int ipAddress1, unsigned short port1)

Returns true if this ApplicationConnector matches the info provided otherAppName is the Application name to compare with. ipAddress1 is the first IPAddress to compare with. port1 is the first port to compare with. ipAddress2 is the second IPAddress to compare with. port2 is the second port to compare with.

char *ApplicationConnector::Name()

Read remote application name.

void ApplicationConnector::ResetMaxBlockingTimer()

Reset the last max BlockingTimeout.

bool ApplicationConnector::ResetTimeoutAndUpdateSendFlag()

m_dTimeout is reset to new value (CDPTime::GetGlobalTimeFromHardware() + m_dDisconnectTimeout).

  • sendIpPair is set to true (indicating that we can send on specified interface).
  • Returns true if was timed out previous (sendIpPair was false).

int ApplicationConnector::SendBroadcastMessage(MessageTransportPacket *message)

Broadcast a message.

This method is called by Messenger::GetInstance()->ProcessSend(). Return values

  • 0: Message sent OK
  • -1: Message not sent (an error occurred, usually a socket-error)
Parameter messageThe message to be sent.

int ApplicationConnector::SendMessage(MessageTransportPacket *message)

Send message to remote application.

Return-values:

  • 0: Message sent OK
  • -1: Message not sent (an error occurred, usually a socket-error)

void ApplicationConnector::SetName(const char *name)

Set the name of remote application.

void ApplicationConnector::SetStudioAPIIpAddress(const IpAddress &addr)

const IpAddress &ApplicationConnector::StudioAPIIpAddress() const

Returns ApplicationConnector's remote StudioAPI ip address. IpAddress contain both address and port information.

bool ApplicationConnector::Timeout()

Returns true if ApplicationConnector to remote application has timed out (not received notify for a period). If this ApplicationConnector is not used/occupied, false is returned.

bool ApplicationConnector::VerifyIPAddress(int32_t otherAppIpAddress, unsigned short _port)

Verifies if registered information about IP address(es) and port(s) in this connector matches info in received MessageApplicationNotify.

Returns true if information matches (OK).

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

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top