Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Member Functions | Static Public Member Functions | List of all members
Pothos::RemoteServer Class Reference

#include <Server.hpp>

Inheritance diagram for Pothos::RemoteServer:
Inheritance graph
[legend]

Public Member Functions

 RemoteServer (void)
 Make an empty handle. More...
 
 RemoteServer (const std::string &uri, const bool closePipes=true)
 
const std::string & getUri (void) const
 Get the server's bind URI. More...
 
 operator bool (void) const
 Is this remove server active? More...
 
std::string getActualPort (void) const
 Get the actual port that the server is running on. More...
 
void startSyslogForwarding (const std::string &addr, const std::string &source)
 
- Public Member Functions inherited from Pothos::Util::RefHolder
virtual ~RefHolder (void)
 Virtual destructor for derived classes. More...
 
void holdRef (const Object &container)
 Store a copy of this object container. More...
 
void dropRef (const Object &container)
 Drop a copy of this object container. More...
 

Static Public Member Functions

static std::string getLocatorPort (void)
 

Detailed Description

A remote server is a handle for an executing server process. When all copies of the handle destruct, the server process will be terminated.

Constructor & Destructor Documentation

◆ RemoteServer() [1/2]

Pothos::RemoteServer::RemoteServer ( void  )

Make an empty handle.

◆ RemoteServer() [2/2]

Pothos::RemoteServer::RemoteServer ( const std::string &  uri,
const bool  closePipes = true 
)

Spawn a new process on this machine, that is running a proxy server on the given URI. URI format: tcp://resolvable_hostname:optional_port A host address of 0.0.0.0 or [::] will bind the server to all interfaces. An unspecified port means that an available port will be automatically chosen.

Parameters
uria formatted string which tells the server what kind of service to run
closePipestrue to close stdout/err pipes (keep open for syslog forwarding)
Returns
a handle that when deleted, will cause the server/process to exit

Member Function Documentation

◆ getActualPort()

std::string Pothos::RemoteServer::getActualPort ( void  ) const

Get the actual port that the server is running on.

◆ getLocatorPort()

static std::string Pothos::RemoteServer::getLocatorPort ( void  )
static

The locator port is the default port for running and locating a remote server. Servers running on this part are used to establish initial communication. Further communication can continue on arbitrary ports selected by the OS.

◆ getUri()

const std::string& Pothos::RemoteServer::getUri ( void  ) const

Get the server's bind URI.

◆ operator bool()

Pothos::RemoteServer::operator bool ( void  ) const
explicit

Is this remove server active?

◆ startSyslogForwarding()

void Pothos::RemoteServer::startSyslogForwarding ( const std::string &  addr,
const std::string &  source 
)

Start syslog forwarding to the given address. Spawn threads to read the stdout/err pipes from the server process and forward to a syslog channel. Only use when the server is created with closePipes false.

Parameters
addrthe log destination in host:port format
sourcethe repoted source of the log messages

The documentation for this class was generated from the following file: