Commit 9a644838b6c5403e0025cd2c385ab906f6a7c042
1 parent
1cbb4892
Exists in
master
and in
5 other branches
Incluindo método para encerrar a sessão no serviço.
Showing
4 changed files
with
11 additions
and
0 deletions
Show diff stats
src/include/pw3270cpp.h
@@ -145,6 +145,7 @@ | @@ -145,6 +145,7 @@ | ||
145 | static void set_plugin(session * (*factory)(const char *name)); | 145 | static void set_plugin(session * (*factory)(const char *name)); |
146 | 146 | ||
147 | virtual string get_session_name(void) const; | 147 | virtual string get_session_name(void) const; |
148 | + virtual int close(void); | ||
148 | 149 | ||
149 | // Log management | 150 | // Log management |
150 | void log(const char *fmt, ...); | 151 | void log(const char *fmt, ...); |
src/libpw3270cpp/service.cc
@@ -326,6 +326,11 @@ | @@ -326,6 +326,11 @@ | ||
326 | return getInteger("isReady", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); | 326 | return getInteger("isReady", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); |
327 | } | 327 | } |
328 | 328 | ||
329 | + virtual int close(void) | ||
330 | + { | ||
331 | + return getInteger("destroySession", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); | ||
332 | + } | ||
333 | + | ||
329 | virtual LIB3270_CSTATE get_cstate(void) | 334 | virtual LIB3270_CSTATE get_cstate(void) |
330 | { | 335 | { |
331 | return (LIB3270_CSTATE) getInteger("getConnectionState", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); | 336 | return (LIB3270_CSTATE) getInteger("getConnectionState", DBUS_TYPE_STRING, &this->id, DBUS_TYPE_INVALID); |
src/libpw3270cpp/session.cc
src/libpw3270cpp/testprogram.cc
@@ -74,6 +74,8 @@ | @@ -74,6 +74,8 @@ | ||
74 | cout << "Conteúdo:" << endl << session->get_contents() << endl; | 74 | cout << "Conteúdo:" << endl << session->get_contents() << endl; |
75 | 75 | ||
76 | session->disconnect(); | 76 | session->disconnect(); |
77 | + session->close(); | ||
78 | + | ||
77 | delete session; | 79 | delete session; |
78 | } | 80 | } |
79 | catch(std::exception &e) { | 81 | catch(std::exception &e) { |