A class that represents a Telnet option's client side.
More...
#include <client_option.hpp>
|
enum | state { inactive,
activating,
active,
deactivating
} |
| An enumeration of the different states in which this option can be. More...
|
|
A class that represents a Telnet option's client side.
That is, the side that received WILL and WONT negotiations and sends DO and DONT negotiations.
- Server vs. Client
- Note that the usage of client in this context may disagree with a particular option's RFC specification. The determination of what is a client and what is a server is not rigorously applies throughout the RFCs, so consider this merely an implementation detail of this library.
- Usage
- client_option provides a general interface to enable the implementation of the client sides of all Telnet options. There are two customization points that must be filled in before an implementation is complete:
- the derived class must call the constructor, passing in a value that is the Option Code for the feature being implemented.
- the derived class must implement the handle_subnegotiation function. This is called whenever data specific to the option passes through the Telnet layer.
A final third customization point is the on_state_changed signal, to which a user can connect to have functionality executed when the option changes state.
- See also
- https://tools.ietf.org/html/std8
An enumeration of the different states in which this option can be.
telnetpp::client_option::client_option |
( |
telnetpp::u8 |
option | ) |
|
|
explicitprotected |
Constructor.
- Parameters
-
option | The Option Code of this option. |
std::vector< telnetpp::token > telnetpp::client_option::negotiate |
( |
telnetpp::u8 |
request | ) |
|
Makes a request of the option and returns the response from that request.
void telnetpp::client_option::set_activatable |
( |
| ) |
|
Flags the option as remotely activatable.
Allows the option to be activated by the remote end. That is, if the option receives a WILL negotiation, it will respond with a DO negotiation. An option that has not have this function called will instead respond with a DONT negotiation.
Send a subnegotiation to the option and returns the response from that subnegotiation.
A signal that you can connect to in order to detect changes in the state of the option.
- Usage
my_option.on_state_changed.connect(
-> std::vector<telnetpp::token>
{
std::cout << "state is now: " << new_state << "\n";
return {};
});
- See also
- telnetpp::client_option::state
The documentation for this class was generated from the following files: