Commit 5d07ecbfa8a682f5fe102aacd162f96c0d8e1449

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

Removing URL & timeout for the Host class constructor.

client/src/host/init.cc
@@ -40,17 +40,16 @@ @@ -40,17 +40,16 @@
40 40
41 /*---[ Implement ]----------------------------------------------------------------------------------*/ 41 /*---[ Implement ]----------------------------------------------------------------------------------*/
42 42
43 -TN3270::Host::Host(const char *id, const char *url, time_t timeout, const char *charset) { 43 +TN3270::Host::Host(const char *id, const char *charset) {
44 44
45 debug("Creating host id=\"", id); 45 debug("Creating host id=\"", id);
46 46
47 - this->timeout = timeout; 47 + this->timeout = 5;
48 this->session = Session::getInstance(id, charset); 48 this->session = Session::getInstance(id, charset);
49 - if(url) {  
50 - this->connect(url);  
51 - } 49 +
52 } 50 }
53 51
  52 +
54 TN3270::Host::~Host() { 53 TN3270::Host::~Host() {
55 delete this->session; 54 delete this->session;
56 this->session = nullptr; 55 this->session = nullptr;
client/src/include/lib3270/ipc.h
@@ -675,7 +675,8 @@ @@ -675,7 +675,8 @@
675 */ 675 */
676 676
677 public: 677 public:
678 - Host(const char *id = nullptr, const char *url = nullptr, time_t timeout = DEFAULT_TIMEOUT, const char *charset = nullptr); 678 + Host(const char *id, const char *charset = nullptr);
  679 +
679 ~Host(); 680 ~Host();
680 681
681 inline bool operator==(ConnectionState state) const noexcept { 682 inline bool operator==(ConnectionState state) const noexcept {
client/src/testprogram/testprogram.cc
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 // Test Attributes 97 // Test Attributes
98 static void testAttributes(const char *session) { 98 static void testAttributes(const char *session) {
99 99
100 - TN3270::Host host{session,nullptr,10}; 100 + TN3270::Host host{session};
101 101
102 for(auto attribute : host.getAttributes()) { 102 for(auto attribute : host.getAttributes()) {
103 103
@@ -123,7 +123,7 @@ @@ -123,7 +123,7 @@
123 123
124 try { 124 try {
125 125
126 - TN3270::Host host{session,nullptr,10}; 126 + TN3270::Host host{session};
127 127
128 cout 128 cout
129 << "Version: " << host["version"] 129 << "Version: " << host["version"]
@@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
204 #endif // _WIN32 204 #endif // _WIN32
205 205
206 cout << "Session: " << session << endl; 206 cout << "Session: " << session << endl;
207 - 207 +
208 testHost(session); 208 testHost(session);
209 209
210 210