Commit abf1107e98f214e2ff0d0207f505443bc54a3c06
1 parent
fd925a04
Exists in
master
and in
1 other branch
Updating convenience object.
Showing
5 changed files
with
10 additions
and
12 deletions
Show diff stats
client/src/core/host.cc
| ... | ... | @@ -65,11 +65,9 @@ |
| 65 | 65 | this->session = nullptr; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - Host & Host::connect(const char *url, bool sync) { | |
| 69 | - this->session->connect(url); | |
| 70 | - if(sync) { | |
| 71 | - this->sync(); | |
| 72 | - } | |
| 68 | + Host & Host::connect(const char *url) { | |
| 69 | + this->session->connect(url,timeout); | |
| 70 | + this->sync(); | |
| 73 | 71 | return *this; |
| 74 | 72 | } |
| 75 | 73 | ... | ... |
client/src/session/local/actions.cc
| ... | ... | @@ -48,10 +48,10 @@ |
| 48 | 48 | chkResponse(lib3270_action(hSession,action_name)); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - void Local::Session::connect(const char *url, bool wait) { | |
| 51 | + void Local::Session::connect(const char *url, int seconds) { | |
| 52 | 52 | |
| 53 | 53 | std::lock_guard<std::mutex> lock(sync); |
| 54 | - chkResponse(lib3270_connect_url(hSession,url,(wait ? 1 : 0))); | |
| 54 | + chkResponse(lib3270_connect_url(hSession,url,seconds)); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | void Local::Session::disconnect() { | ... | ... |
client/src/session/local/private.h
| ... | ... | @@ -93,7 +93,7 @@ |
| 93 | 93 | |
| 94 | 94 | // Actions |
| 95 | 95 | void action(const char *action_name) override; |
| 96 | - void connect(const char *url, bool wait) override; | |
| 96 | + void connect(const char *url, int seconds) override; | |
| 97 | 97 | void disconnect() override; |
| 98 | 98 | void pfkey(unsigned short value) override; |
| 99 | 99 | void pakey(unsigned short value) override; | ... | ... |
client/src/testprogram/testprogram.cc
| ... | ... | @@ -87,7 +87,7 @@ |
| 87 | 87 | // test host object |
| 88 | 88 | static void testHost(const char *session) { |
| 89 | 89 | |
| 90 | - TN3270::Host host{session}; | |
| 90 | + TN3270::Host host{session,nullptr,10}; | |
| 91 | 91 | |
| 92 | 92 | try { |
| 93 | 93 | |
| ... | ... | @@ -96,7 +96,7 @@ |
| 96 | 96 | << "\tRevision: " << host.getRevision() |
| 97 | 97 | << std::endl; |
| 98 | 98 | |
| 99 | - host.connect(); | |
| 99 | + host.connect(nullptr); | |
| 100 | 100 | |
| 101 | 101 | cout |
| 102 | 102 | << "Connection state is " << toCharString(host.getConnectionState()) << std::endl | ... | ... |
common/src/include/lib3270/ipc.h
| ... | ... | @@ -322,7 +322,7 @@ |
| 322 | 322 | virtual void action(const char *action_name) = 0; |
| 323 | 323 | |
| 324 | 324 | // Connect/disconnect |
| 325 | - virtual void connect(const char *url = nullptr, bool wait = true) = 0; | |
| 325 | + virtual void connect(const char *url = nullptr, int seconds = DEFAULT_TIMEOUT) = 0; | |
| 326 | 326 | virtual void disconnect() = 0; |
| 327 | 327 | |
| 328 | 328 | /// @brief Wait. |
| ... | ... | @@ -416,7 +416,7 @@ |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | // Actions |
| 419 | - Host & connect(const char *url = nullptr, bool sync = true); | |
| 419 | + Host & connect(const char *url = nullptr); | |
| 420 | 420 | Host & disconnect(); |
| 421 | 421 | Host & waitForReady(time_t timeout = DEFAULT_TIMEOUT); |
| 422 | 422 | ... | ... |