Commit 360ce5711319d09591e4475fcb427f086dc8d578

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

Adding optional "wait" argument on action activation.

client/src/include/lib3270/ipc/action.h
... ... @@ -54,7 +54,7 @@
54 54  
55 55 public:
56 56 virtual bool activatable() const noexcept = 0;
57   - virtual void activate() = 0;
  57 + virtual void activate(time_t seconds = 0) = 0;
58 58 virtual ~Action();
59 59  
60 60 inline operator bool() const noexcept {
... ...
client/src/session/local/actions.cc
... ... @@ -55,10 +55,16 @@
55 55 return lib3270_action_is_activatable(this->descriptor,this->session->hSession);
56 56 }
57 57  
58   - void Local::Action::activate() {
  58 + void Local::Action::activate(time_t seconds) {
59 59 std::lock_guard<std::mutex> lock(this->session->sync);
  60 +
60 61 debug(__FUNCTION__,"(",(void *) descriptor,")");
  62 +
61 63 chkResponse(lib3270_action_activate(this->descriptor,this->session->hSession));
  64 +
  65 + if(seconds)
  66 + chkResponse(lib3270_wait_for_ready(this->session->hSession,seconds));
  67 +
62 68 }
63 69  
64 70 TN3270::Action * Local::Session::getAction(const LIB3270_ACTION *descriptor) {
... ...
client/src/session/local/private.h
... ... @@ -63,7 +63,7 @@
63 63 public:
64 64 Action(Session *hSession, const LIB3270_ACTION *descriptor);
65 65 bool activatable() const noexcept override;
66   - void activate() override;
  66 + void activate(time_t seconds) override;
67 67  
68 68 };
69 69  
... ...