diff --git a/pw3270.cbp b/pw3270.cbp
index 83ef6ba..161cca5 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -89,11 +89,11 @@
-
+
diff --git a/src/include/lib3270.h b/src/include/lib3270.h
index c127cc8..7986af1 100644
--- a/src/include/lib3270.h
+++ b/src/include/lib3270.h
@@ -499,6 +499,18 @@
*/
LIB3270_EXPORT int lib3270_connect_host(H3270 *hSession, const char *hostname, const char *srvc, LIB3270_OPTION opt);
+ /**
+ * @brief Connect by URL
+ *
+ * @param hSession Session handle.
+ * @param url Host URL
+ * @param wait Seconds to wait for connection.
+ *
+ * @see lib3270_wait
+ *
+ * @return 0 for success, EAGAIN if auto-reconnect is in progress, EBUSY if connected, ENOTCONN if connection has failed, -1 on unexpected failure.
+ */
+ LIB3270_EXPORT int lib3270_connect_url(H3270 *hSession, const char *url, int wait);
/**
* Disconnect from host.
diff --git a/src/include/pw3270cpp.h b/src/include/pw3270cpp.h
index ea0f6ba..9f9efaa 100644
--- a/src/include/pw3270cpp.h
+++ b/src/include/pw3270cpp.h
@@ -180,12 +180,8 @@
virtual string get_display_charset(void);
// Connection & Network
- int connect(const char *host, time_t wait = 0);
+ virtual int connect(const char *host = "", time_t wait = 0) = 0;
int set_host(const char *host);
- virtual int connect(void) = 0;
-
- virtual int set_url(const char *hostname) = 0;
- virtual string get_url() = 0;
virtual int disconnect(void) = 0;
virtual int wait_for_ready(int seconds) = 0;
diff --git a/src/lib3270/connect.c b/src/lib3270/connect.c
index 2d4d68d..3dd185c 100644
--- a/src/lib3270/connect.c
+++ b/src/lib3270/connect.c
@@ -180,6 +180,19 @@ static void net_connected(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *d
}
#endif // WIN32
+ LIB3270_EXPORT int lib3270_connect_url(H3270 *hSession, const char *url, int wait)
+ {
+ CHECK_SESSION_HANDLE(hSession);
+
+ if(url && *url)
+ {
+ lib3270_set_url(hSession,url);
+ }
+
+ return lib3270_connect(hSession, wait);
+
+ }
+
LIB3270_EXPORT int lib3270_connect_host(H3270 *hSession, const char *hostname, const char *srvc, LIB3270_OPTION opt)
{
CHECK_SESSION_HANDLE(hSession);
--
libgit2 0.21.2