Commit 47d182ccc37816481871f4317985f6585d68ca5c
1 parent
9a644838
Exists in
master
and in
5 other branches
Incluindo métodos para definir timeout de sessão no serviço.
Showing
3 changed files
with
32 additions
and
0 deletions
Show diff stats
src/include/pw3270cpp.h
... | ... | @@ -147,6 +147,9 @@ |
147 | 147 | virtual string get_session_name(void) const; |
148 | 148 | virtual int close(void); |
149 | 149 | |
150 | + virtual void set_timeout(time_t timeout); | |
151 | + virtual void set_autoclose(time_t timeout); | |
152 | + | |
150 | 153 | // Log management |
151 | 154 | void log(const char *fmt, ...); |
152 | 155 | void logva(const char *fmt, va_list args); | ... | ... |
src/libpw3270cpp/service.cc
... | ... | @@ -331,6 +331,16 @@ |
331 | 331 | return getInteger("destroySession", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); |
332 | 332 | } |
333 | 333 | |
334 | + void set_timeout(time_t timeout) { | |
335 | + dbus_int32_t val = (dbus_int32_t) timeout; | |
336 | + getInteger("setTimeout", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID); | |
337 | + } | |
338 | + | |
339 | + void set_autoclose(time_t timeout) { | |
340 | + dbus_int32_t val = (dbus_int32_t) timeout; | |
341 | + getInteger("setAutoClose", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID); | |
342 | + } | |
343 | + | |
334 | 344 | virtual LIB3270_CSTATE get_cstate(void) |
335 | 345 | { |
336 | 346 | return (LIB3270_CSTATE) getInteger("getConnectionState", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); | ... | ... |
src/libpw3270cpp/session.cc
... | ... | @@ -709,6 +709,25 @@ |
709 | 709 | int session::close(void) { |
710 | 710 | return 0; |
711 | 711 | } |
712 | + | |
713 | + /** | |
714 | + * @brief Define após quantos segundos uma sessão IDLE será cancelada. | |
715 | + * | |
716 | + * @param timeout Nº de segundos a esperar em sessão inativa. | |
717 | + * | |
718 | + */ | |
719 | + void session::set_timeout(time_t timeout) { | |
720 | + } | |
721 | + | |
722 | + /** | |
723 | + * @brief Define após quantos segundos uma sessão offline será cancelada. | |
724 | + * | |
725 | + * @param timeout Nº de segundos a esperar em sessão offline. | |
726 | + * | |
727 | + */ | |
728 | + void session::set_autoclose(time_t timeout) { | |
729 | + } | |
730 | + | |
712 | 731 | } |
713 | 732 | |
714 | 733 | ... | ... |