Commit 1d9706d1235b353fb45a2753f9ce4edfc5eb297b

Authored by Perry Werneck
1 parent abf1107e
Exists in master and in 1 other branch develop

Fixing timing errors.

client/src/core/host.cc
... ... @@ -67,7 +67,6 @@
67 67  
68 68 Host & Host::connect(const char *url) {
69 69 this->session->connect(url,timeout);
70   - this->sync();
71 70 return *this;
72 71 }
73 72  
... ... @@ -101,6 +100,11 @@
101 100  
102 101 }
103 102  
  103 + Host::operator bool() const {
  104 + const_cast<Host *>(this)->sync();
  105 + return isReady();
  106 + }
  107 +
104 108 bool Host::isReady() const {
105 109 return getProgramMessage() == MESSAGE_NONE;
106 110 }
... ...
client/src/session/local/actions.cc
... ... @@ -71,7 +71,6 @@
71 71  
72 72 std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync);
73 73 chkResponse(lib3270_wait_for_ready(this->hSession, timeout));
74   -
75 74 }
76 75  
77 76 void Local::Session::waitForChange(unsigned short seconds) const {
... ...
client/src/testprogram/testprogram.cc
... ... @@ -104,12 +104,14 @@
104 104 << "Luname is " << host.getLUName() << std::endl
105 105 << std::endl;
106 106  
  107 + if(host) {
  108 + cout << host << endl;
  109 + }
107 110  
108 111 // host.input("test@0another line");
109 112  
110 113 //host.connect();
111 114 //if(host) {
112   - // cout << host << endl;
113 115 //}
114 116  
115 117 } catch(const std::exception &e) {
... ...
common/src/include/lib3270/ipc.h
... ... @@ -209,7 +209,7 @@
209 209 WORD_NEXT,
210 210 FIELD_END, ///< @brief Move the cursor to the first blank after the last nonblank in the field.
211 211 FIELD_FIRST, ///< @brief Move to first unprotected field on screen.
212   - FIELD_NEXT,
  212 + FIELD_NEXT, ///< @brief Jump to the next field.
213 213 FIELD_PREVIOUS, ///< @brief Tab backward to previous field.
214 214 ATTN, ///< @brief ATTN key, per RFC 2355. Sends IP, regardless.
215 215 BREAK,
... ... @@ -430,9 +430,7 @@
430 430 return session->getProgramMessage();
431 431 }
432 432  
433   - inline operator bool() const {
434   - return isReady();
435   - }
  433 + operator bool() const;
436 434  
437 435 inline operator ProgramMessage() const {
438 436 return getProgramMessage();
... ...