ApplicationConnector Class
Connected application list item with message sending capability. This class is used by Messenger. More...
Header: | #include <CDPSystem/Messenger/ApplicationConnector.h> |
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 |
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, int bufferIndex) |
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
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 wasfalse
).
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 message | The message to be sent. |
int ApplicationConnector::SendMessage(MessageTransportPacket *message, int bufferIndex)
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).
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.