Commit 9209d08d422f1568249c6a33a0f0860d0ddd34ff
1 parent
9cd7c3e2
Exists in
master
and in
1 other branch
Fixing connection issues.
Showing
1 changed file
with
24 additions
and
2 deletions
Show diff stats
src/core/calls.cc
| @@ -50,10 +50,12 @@ | @@ -50,10 +50,12 @@ | ||
| 50 | { | 50 | { |
| 51 | try { | 51 | try { |
| 52 | 52 | ||
| 53 | - getSession().connect((const char *) uri); | 53 | + TN3270::Host &host = getSession(); |
| 54 | + | ||
| 55 | + host.connect((const char *) uri); | ||
| 54 | 56 | ||
| 55 | if(wait) | 57 | if(wait) |
| 56 | - return hllapi_wait_for_ready(wait); | 58 | + host.wait(TN3270::CONNECTED_TN3270E); |
| 57 | 59 | ||
| 58 | } catch(const std::exception &e) { | 60 | } catch(const std::exception &e) { |
| 59 | 61 | ||
| @@ -183,6 +185,26 @@ | @@ -183,6 +185,26 @@ | ||
| 183 | 185 | ||
| 184 | } | 186 | } |
| 185 | 187 | ||
| 188 | + HLLAPI_API_CALL hllapi_wait_for_cstate(WORD seconds, WORD cstate) { | ||
| 189 | + | ||
| 190 | + try { | ||
| 191 | + | ||
| 192 | + TN3270::Host &host = getSession(); | ||
| 193 | + | ||
| 194 | + host.wait((TN3270::ConnectionState) cstate, (unsigned int) seconds); | ||
| 195 | + | ||
| 196 | + return 0; | ||
| 197 | + | ||
| 198 | + } catch(const std::exception &e) { | ||
| 199 | + | ||
| 200 | + hllapi_lasterror = e.what(); | ||
| 201 | + | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + return HLLAPI_STATUS_SYSTEM_ERROR; | ||
| 205 | + | ||
| 206 | + } | ||
| 207 | + | ||
| 186 | HLLAPI_API_CALL hllapi_wait_for_change(WORD seconds) { | 208 | HLLAPI_API_CALL hllapi_wait_for_change(WORD seconds) { |
| 187 | 209 | ||
| 188 | try { | 210 | try { |