diff --git a/src/core/calls.cc b/src/core/calls.cc index 6dcec6e..831fc4d 100644 --- a/src/core/calls.cc +++ b/src/core/calls.cc @@ -50,10 +50,12 @@ { try { - getSession().connect((const char *) uri); + TN3270::Host &host = getSession(); + + host.connect((const char *) uri); if(wait) - return hllapi_wait_for_ready(wait); + host.wait(TN3270::CONNECTED_TN3270E); } catch(const std::exception &e) { @@ -183,6 +185,26 @@ } + HLLAPI_API_CALL hllapi_wait_for_cstate(WORD seconds, WORD cstate) { + + try { + + TN3270::Host &host = getSession(); + + host.wait((TN3270::ConnectionState) cstate, (unsigned int) seconds); + + return 0; + + } catch(const std::exception &e) { + + hllapi_lasterror = e.what(); + + } + + return HLLAPI_STATUS_SYSTEM_ERROR; + + } + HLLAPI_API_CALL hllapi_wait_for_change(WORD seconds) { try { -- libgit2 0.21.2