Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
DefaultSocketClientParams Class Reference

Default implementation that supplies parametrized values for static and mdns connection methods. More...

#include <SocketClientParams.hxx>

Inheritance diagram for DefaultSocketClientParams:
EmptySocketClientParams SocketClientParams

Public Member Functions

string mdns_service_name () override
 
string manual_host_name () override
 
int manual_port () override
 
- Public Member Functions inherited from EmptySocketClientParams
SearchMode search_mode () override
 
string mdns_service_name () override
 
string mdns_host_name () override
 
string manual_host_name () override
 
int manual_port () override
 
bool enable_last () override
 
string last_host_name () override
 
int last_port () override
 
- Public Member Functions inherited from SocketClientParams
virtual bool one_shot ()
 
virtual void set_last (const char *hostname, int port)
 This function is called on an unspecified thread when a connection is successfully established.
 
virtual void log_message (LogMessage id, const string &arg=string())
 Notifies the caller about the current phase of the connection.
 
virtual int retry_seconds ()
 
virtual int timeout_seconds ()
 
virtual bool disallow_local ()
 

Protected Attributes

string staticHost_
 what to return for manual_host_name
 
int staticPort_ = -1
 what to return for manual_port
 
string mdnsService_
 what to return for mdns_service_name
 

Friends

std::unique_ptr< SocketClientParamsSocketClientParams::from_static (string hostname, int port)
 
std::unique_ptr< SocketClientParamsSocketClientParams::from_static_and_mdns (string hostname, int port, string mdns_service)
 

Additional Inherited Members

- Public Types inherited from SocketClientParams
enum  SearchMode { AUTO_MANUAL = 0 , MANUAL_AUTO = 1 , AUTO_ONLY = 2 , MANUAL_ONLY = 3 }
 Parameter that determines what order we will attempt to connect. More...
 
enum  LogMessage {
  CYCLE_START = 0 , CONNECT_RE = 1 , MDNS_SEARCH = 2 , MDNS_NOT_FOUND = 3 ,
  MDNS_FOUND = 4 , CONNECT_MDNS = 5 , CONNECT_MANUAL = 6 , CONNECT_FAILED_SELF = 7 ,
  CONNECT_FAILED_ONESHOT = 8 , CONNECTION_LOST
}
 Enum for sending connection status updates to the caller. More...
 
- Static Public Member Functions inherited from SocketClientParams
static std::unique_ptr< SocketClientParamsfrom_static (string hostname, int port)
 
static std::unique_ptr< SocketClientParamsfrom_static_and_mdns (string hostname, int port, string mdns_service)
 

Detailed Description

Default implementation that supplies parametrized values for static and mdns connection methods.

Definition at line 243 of file SocketClientParams.hxx.

Member Function Documentation

◆ manual_host_name()

string DefaultSocketClientParams::manual_host_name ( )
inlineoverridevirtual
Returns
null or empty string if no manual address is configured. Otherwise a dotted-decimal IP address or a DNS hostname (not mDNS) for manual address to connect to.

Implements SocketClientParams.

Definition at line 256 of file SocketClientParams.hxx.

◆ manual_port()

int DefaultSocketClientParams::manual_port ( )
inlineoverridevirtual
Returns
port number to use for manual connection.

Implements SocketClientParams.

Definition at line 262 of file SocketClientParams.hxx.

◆ mdns_service_name()

string DefaultSocketClientParams::mdns_service_name ( )
inlineoverridevirtual
Returns
the service name to use for mDNS lookup; nullptr or empty string if mdns is not to be used.

Implements SocketClientParams.

Definition at line 248 of file SocketClientParams.hxx.

Member Data Documentation

◆ mdnsService_

string DefaultSocketClientParams::mdnsService_
protected

what to return for mdns_service_name

Definition at line 279 of file SocketClientParams.hxx.

◆ staticHost_

string DefaultSocketClientParams::staticHost_
protected

what to return for manual_host_name

Definition at line 275 of file SocketClientParams.hxx.

◆ staticPort_

int DefaultSocketClientParams::staticPort_ = -1
protected

what to return for manual_port

Definition at line 277 of file SocketClientParams.hxx.


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