|
Jpp
|
ControlHost class. More...
#include <JControlHost.hh>
Public Member Functions | |
| JControlHost (const JHostname &server) | |
| Constructor. More... | |
| JControlHost (const std::string &server, const int port) | |
| Constructor. More... | |
| JControlHost (const int ip_number, const int port=DISPATCH_PORT) | |
| Constructor. More... | |
| JControlHost (const JSocket &socket) | |
| Constructor. More... | |
| ~JControlHost () | |
| Destructor. More... | |
| int | Subscribe (const JSubscription &subscription) |
| Subscribe to single tag. More... | |
| int | Subscribe (const JSubscriptionList &subscription) |
| Subscribe to list of tags. More... | |
| int | MyId (const std::string &nick_name) |
| Identify. More... | |
| int | SendMeNext () |
| Tell server to send next message. More... | |
| int | SendMeAlways () |
| Tell server to send messages forever. More... | |
| int | PutFullData (const JTag &tag, const void *buffer, const int length) |
| Send data. More... | |
| int | PutFullData (const std::string &tag, const void *buffer, const int length) |
| Send data. More... | |
| int | PutFullString (const JTag &tag, const std::string &buffer) |
| Send string. More... | |
| int | PutFullString (const std::string &tag, const std::string &buffer) |
| Send string. More... | |
| int | Connected () |
| Send version. More... | |
| int | WaitHead (JPrefix &prefix) |
| Wait for header. More... | |
| int | WaitHead (std::string &tag, int &length) |
| Wait for header. More... | |
| int | CheckHead (JPrefix &prefix, JTimeval timeout=JTimeval::min()) |
| Check for header, without waiting. More... | |
| int | CheckHead (std::string &tag, int &length, const int timeout_us=0) |
| Check for header, without waiting. More... | |
| int | GetFullData (void *buffer, int length) |
| Receive data. More... | |
| int | GetFullString (std::string &buffer) |
| Receive string. More... | |
| int | configure () |
| Configure socket (factory reset). More... | |
| int | read (char *buffer, const int length) |
| Read data from socket. More... | |
| int | write (const char *buffer, const int length) |
| Write data to socket. More... | |
| int | shutdown () |
| Shut down socket. More... | |
| void | setNonBlocking (const bool on) |
| Set non-blocking of I/O. More... | |
| bool | getNonBlocking () const |
| Get non-blocking of I/O. More... | |
| void | setKeepAlive (const bool on) |
| Set keep alive of socket. More... | |
| bool | getKeepAlive () const |
| Get keep alive of socket. More... | |
| void | setKeepIdle (const int t_s) |
| Set the TCP idle time. More... | |
| void | setKeepCnt (const int count) |
| Set the TCP idle count. More... | |
| void | setKeepIntvl (const int t_s) |
| Set the TCP interval time. More... | |
| void | setReuseAddress (const bool on) |
| Set reuse address. More... | |
| bool | getReuseAddress () const |
| Get reuse address. More... | |
| void | setTcpNoDelay (const bool on) |
| Set TCP no-delay. More... | |
| bool | getTcpNoDelay () const |
| Get TCP no-delay. More... | |
| void | setReceiveBufferSize (const int size) |
| Set receive buffer size. More... | |
| int | getReceiveBufferSize () const |
| Set receive buffer size. More... | |
| void | setSendBufferSize (const int size) |
| Set send buffer size. More... | |
| int | getSendBufferSize () const |
| Get send buffer size. More... | |
| void | accept (const int server) |
| Accept connection from a server. More... | |
| void | connect (const int port) |
| Connect to port on local host. More... | |
| void | connect (const std::string &host_name, const int port) |
| Connect to port on specified host. More... | |
| void | connect (const int ip_number, const int port) |
| Connect to port on specified host. More... | |
| void | close () |
| Close file. More... | |
| bool | in_avail (JTimeval timeout=JTimeval::min()) const |
| Check availability of input. More... | |
| bool | out_avail (JTimeval timeout=JTimeval::min()) const |
| Check availability of output. More... | |
| virtual bool | good () const |
| Check status. More... | |
| virtual bool | fail () const |
| Check status. More... | |
| virtual bool | bad () const |
| Check status. More... | |
| virtual bool | eof () const |
| Check end of file. More... | |
| bool | less (const JAbstractFile &file) const |
| Less than operation. More... | |
| int | getFileDescriptor () const |
| Get file descriptor. More... | |
| bool | is_open () const |
| Get open status. More... | |
| const sockaddr * | getSockaddr () const |
| Get sockaddr. More... | |
| sockaddr * | getSockaddr () |
| Get sockaddr. More... | |
| int | getFamily () const |
| Get family. More... | |
| void | setFamily (const int family) |
| Set family. More... | |
| std::string | getHostname () const |
| Get host name. More... | |
| int | getIPnumber () const |
| Get IP number. More... | |
| void | setIPnumber (const int ip_number) |
| Set IP number. More... | |
| void | setIPnumber () |
| Set any IP number. More... | |
| int | getPort () const |
| Get port number. More... | |
| void | setPort (const int port) |
| Set port number. More... | |
Static Public Member Functions | |
| static bool | maybe_special (const JTag &tag) |
| Check special ControlHost tags. More... | |
| static bool | is_valid (const char c) |
| Check validity of subscription specifier. More... | |
| static int | WhereIs (const std::string &host_name, const std::string &nick_name, std::string &answer) |
| Locate ControlHost client(s). More... | |
| static int | sizeOf () |
| Get size of object. More... | |
| static void | Throw (const bool option) |
| Enable/disable throw option. More... | |
| static int | Throw (const JException &error, const int value=-1) |
| Throw exception or return error. More... | |
Static Public Attributes | |
| static const int | FILE_CLOSED = -1 |
Protected Member Functions | |
| JControlHost () | |
| Default constructor. More... | |
| template<class T > | |
| void | setOption (const int level, const int option, const T value) |
| Set socket option. More... | |
| template<class T > | |
| T | getOption (const int level, const int option) const |
| Get socket option. More... | |
Protected Attributes | |
| int | fileDescriptor |
Static Protected Attributes | |
| static bool | do_throw |
| throw option More... | |
Private Member Functions | |
| JControlHost (const JControlHost &) | |
| JControlHost & | operator= (const JControlHost &) |
Private Attributes | |
| JPrefix | prefix |
ControlHost class.
Definition at line 220 of file JControlHost.hh.
|
inlineprotected |
Default constructor.
Definition at line 228 of file JControlHost.hh.
|
inline |
Constructor.
| server | host name and optional port number |
Definition at line 267 of file JControlHost.hh.
|
inline |
Constructor.
| server | host name |
| port | port |
Definition at line 285 of file JControlHost.hh.
|
inline |
Constructor.
| ip_number | IP number |
| port | port |
Definition at line 301 of file JControlHost.hh.
|
inline |
Constructor.
| socket | socket |
Definition at line 316 of file JControlHost.hh.
|
inline |
|
private |
|
inlinestatic |
Check special ControlHost tags.
| tag | tag |
Definition at line 242 of file JControlHost.hh.
|
inlinestatic |
Check validity of subscription specifier.
| c | subscription specifier |
Definition at line 254 of file JControlHost.hh.
|
inline |
Subscribe to single tag.
| subscription | subscription |
Definition at line 336 of file JControlHost.hh.
|
inline |
Subscribe to list of tags.
| subscription | subscription |
Definition at line 348 of file JControlHost.hh.
|
inline |
Identify.
| nick_name | nick name |
Definition at line 360 of file JControlHost.hh.
|
inline |
Tell server to send next message.
Definition at line 371 of file JControlHost.hh.
|
inline |
Tell server to send messages forever.
Definition at line 382 of file JControlHost.hh.
|
inline |
Send data.
| tag | tag |
| buffer | data |
| length | number of bytes |
Definition at line 396 of file JControlHost.hh.
|
inline |
Send data.
| tag | tag |
| buffer | data |
| length | number of bytes |
Definition at line 426 of file JControlHost.hh.
|
inline |
Send string.
| tag | tag |
| buffer | data |
Definition at line 449 of file JControlHost.hh.
|
inline |
Send string.
| tag | tag |
| buffer | data |
Definition at line 463 of file JControlHost.hh.
|
inline |
Send version.
Definition at line 475 of file JControlHost.hh.
|
inline |
Wait for header.
| prefix | prefix |
Definition at line 487 of file JControlHost.hh.
|
inline |
Wait for header.
| tag | tag |
| length | number of bytes |
Definition at line 508 of file JControlHost.hh.
|
inline |
Check for header, without waiting.
| prefix | prefix |
| timeout | timeout |
Definition at line 528 of file JControlHost.hh.
|
inline |
Check for header, without waiting.
| tag | tag |
| length | number of bytes |
| timeout_us | timeout [us] |
Definition at line 557 of file JControlHost.hh.
|
inline |
Receive data.
| buffer | data |
| length | number of bytes |
Definition at line 577 of file JControlHost.hh.
|
inline |
Receive string.
| buffer | data |
Definition at line 597 of file JControlHost.hh.
|
inlinestatic |
Locate ControlHost client(s).
| host_name | host name |
| nick_name | nick name |
| answer | list of host names |
Definition at line 613 of file JControlHost.hh.
|
inline |
Configure socket (factory reset).
Definition at line 644 of file JControlHost.hh.
|
private |
|
inlinevirtualinherited |
Read data from socket.
| buffer | buffer |
| length | number of bytes to read |
Reimplemented from JNET::JSocket.
Definition at line 51 of file JSocketBlocking.hh.
|
inlinevirtualinherited |
Write data to socket.
| buffer | buffer |
| length | number of bytes to write |
Reimplemented from JNET::JSocket.
Definition at line 78 of file JSocketBlocking.hh.
|
inlineinherited |
Shut down socket.
Definition at line 94 of file JSocket.hh.
|
inlineinherited |
Set non-blocking of I/O.
| on | true to enable non-blocking; false to disable |
Definition at line 109 of file JSocket.hh.
|
inlineinherited |
Get non-blocking of I/O.
Definition at line 133 of file JSocket.hh.
|
inlineinherited |
Set keep alive of socket.
| on | true to enable keep alive; false to disable |
Definition at line 151 of file JSocket.hh.
|
inlineinherited |
Get keep alive of socket.
Definition at line 162 of file JSocket.hh.
|
inlineinherited |
Set the TCP idle time.
| t_s | time [s] |
Definition at line 173 of file JSocket.hh.
|
inlineinherited |
Set the TCP idle count.
| count | count |
Definition at line 184 of file JSocket.hh.
|
inlineinherited |
Set the TCP interval time.
| t_s | time [s] |
Definition at line 195 of file JSocket.hh.
|
inlineinherited |
Set reuse address.
| on | true to enable reuse address; false to disable |
Definition at line 206 of file JSocket.hh.
|
inlineinherited |
Get reuse address.
Definition at line 217 of file JSocket.hh.
|
inlineinherited |
Set TCP no-delay.
| on | true to set TCP no-delay; false to disable |
Definition at line 228 of file JSocket.hh.
|
inlineinherited |
Get TCP no-delay.
Definition at line 239 of file JSocket.hh.
|
inlineinherited |
Set receive buffer size.
| size | number of bytes |
Definition at line 250 of file JSocket.hh.
|
inlineinherited |
|
inlineinherited |
Set send buffer size.
| size | number of bytes |
Definition at line 272 of file JSocket.hh.
|
inlineinherited |
|
inlineinherited |
Accept connection from a server.
| server | file descriptor of server socket |
Definition at line 372 of file JSocket.hh.
|
inlineinherited |
Connect to port on local host.
| port | port number |
Definition at line 384 of file JSocket.hh.
|
inlineinherited |
Connect to port on specified host.
| host_name | host name |
| port | port number |
Definition at line 396 of file JSocket.hh.
|
inlineinherited |
Connect to port on specified host.
| ip_number | IP number |
| port | port number |
Definition at line 408 of file JSocket.hh.
|
inlineprotectedinherited |
Set socket option.
| level | level |
| option | option |
| value | value |
Definition at line 428 of file JSocket.hh.
|
inlineprotectedinherited |
Get socket option.
| level | level |
| option | option |
Definition at line 446 of file JSocket.hh.
|
inlineinherited |
Check availability of input.
This method returns true if at least one byte can be read without blocking.
| timeout | timeout |
Definition at line 100 of file JFile.hh.
|
inlineinherited |
Check availability of output.
This method returns true if at least one byte can be written without blocking.
| timeout | timeout |
Definition at line 113 of file JFile.hh.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Check status.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Check end of file.
|
inlineinherited |
Less than operation.
| file | JAbstractFile to be compared |
Definition at line 64 of file JAbstractFile.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get host name.
Definition at line 88 of file JSocketAddress.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Set any IP number.
Definition at line 119 of file JSocketAddress.hh.
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
Throw exception or return error.
| error | exception |
| value | return code |
Definition at line 50 of file JThrow.hh.
|
mutableprivate |
Definition at line 664 of file JControlHost.hh.
|
staticinherited |
Definition at line 27 of file JAbstractFile.hh.
|
protectedinherited |
Definition at line 91 of file JAbstractFile.hh.
|
staticprotectedinherited |
1.8.5