Commit ec16bbbd3ed8e415901361365352ac9db6647bcf
1 parent
409647dc
Exists in
master
and in
1 other branch
Small adjustments in the methods.
Showing
2 changed files
with
15 additions
and
6 deletions
Show diff stats
client/src/core/host.cc
| ... | ... | @@ -58,19 +58,22 @@ |
| 58 | 58 | this->session = nullptr; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - void Host::connect(const char *url, bool sync) { | |
| 61 | + Host & Host::connect(const char *url, bool sync) { | |
| 62 | 62 | this->session->connect(url); |
| 63 | 63 | if(sync) { |
| 64 | 64 | this->sync(); |
| 65 | 65 | } |
| 66 | + return *this; | |
| 66 | 67 | } |
| 67 | 68 | |
| 68 | - void Host::disconnect() { | |
| 69 | + Host & Host::disconnect() { | |
| 69 | 70 | this->session->disconnect(); |
| 71 | + return *this; | |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | - void Host::waitForReady(time_t timeout) { | |
| 74 | + Host & Host::waitForReady(time_t timeout) { | |
| 73 | 75 | this->session->waitForReady(timeout); |
| 76 | + return *this; | |
| 74 | 77 | } |
| 75 | 78 | |
| 76 | 79 | /// @brief Writes characters to the associated file from the put area | ... | ... |
common/src/include/lib3270/ipc.h
| ... | ... | @@ -336,10 +336,16 @@ |
| 336 | 336 | return session->getConnectionState() == state; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - void connect(const char *url, bool sync = true); | |
| 340 | - void disconnect(); | |
| 339 | + Host & connect(const char *url, bool sync = true); | |
| 340 | + Host & disconnect(); | |
| 341 | 341 | |
| 342 | - void waitForReady(time_t timeout = DEFAULT_TIMEOUT); | |
| 342 | + Host & waitForReady(time_t timeout = DEFAULT_TIMEOUT); | |
| 343 | + | |
| 344 | + /// @brief Execute action by name. | |
| 345 | + inline Host & action(const char *action_name) { | |
| 346 | + session->action(action_name); | |
| 347 | + return *this; | |
| 348 | + } | |
| 343 | 349 | |
| 344 | 350 | inline ProgramMessage getProgramMessage() const { |
| 345 | 351 | return session->getProgramMessage(); | ... | ... |