• 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
  • RPCServer
  • 5.0.0

RPCServer Class

(ServerIO::RPCServer)

Generic RPC (remote procedure call) binary-message-based server class to be used in RPC service implementers. More...

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

Public Functions

RPCServer(CDPBaseObject *parent, const std::function<void( const MessagePacketHandle & ) > &onClientConnect, const std::function<int( const MessagePacketHandle & ) > &onProcedureCall)
void ForEachClient(const std::function<void( unsigned int ) > &f) const
void SendResponse(unsigned int receiverHandle, MessagePacketHandle &response)
void SendResponse(const MessagePacketHandle &originalProcedureCall, MessagePacketHandle &response)

Static Public Members

std::string ClientLongName(unsigned int client)

Detailed Description

Generic RPC (remote procedure call) binary-message-based server class to be used in RPC service implementers.

See also CDPBaseObject.

Member Function Documentation

RPCServer::RPCServer(CDPBaseObject *parent, const std::function<void( const MessagePacketHandle & ) > &onClientConnect, const std::function<int( const MessagePacketHandle & ) > &onProcedureCall)

Constructs a RPCServer object.

Any CDPBaseObject based node can create and use a instance of this class for easy implementation of RPC service (procedure call receive and response sending).

Parameters:

  • parent - parent object that implements the RPC servicing
  • onClientConnect - will be called after RPC service client was connected to the server (with connectMessage, that contains client handle as parameter)
  • onProcedureCall - will be called on every RPC procedure call from any client (with procedureMessage as a parameter)

See also CDPBaseObject.

[static] std::string RPCServer::ClientLongName(unsigned int client)

Return full CDP path of the client handle

void RPCServer::ForEachClient(const std::function<void( unsigned int ) > &f) const

Call callback f for each currently connected client handle

void RPCServer::SendResponse(unsigned int receiverHandle, MessagePacketHandle &response)

Send the CM_RPC_RESPONSE response message to the receiverHandle

void RPCServer::SendResponse(const MessagePacketHandle &originalProcedureCall, MessagePacketHandle &response)

Send the CM_RPC_RESPONSE response message to the sender of the originalProcedureCall

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