Commit c539cc10ae127d59072be93483c236fac62cb06e
1 parent
52dddb94
Exists in
master
and in
3 other branches
wait_for_ready should wait for "reconnect" process to complete.
Showing
2 changed files
with
16 additions
and
3 deletions
Show diff stats
src/core/wait.c
@@ -49,8 +49,6 @@ LIB3270_EXPORT int lib3270_wait_for_update(H3270 GNUC_UNUSED(*hSession), int GNU | @@ -49,8 +49,6 @@ LIB3270_EXPORT int lib3270_wait_for_update(H3270 GNUC_UNUSED(*hSession), int GNU | ||
49 | 49 | ||
50 | LIB3270_EXPORT int lib3270_wait_for_ready(H3270 *hSession, int seconds) | 50 | LIB3270_EXPORT int lib3270_wait_for_ready(H3270 *hSession, int seconds) |
51 | { | 51 | { |
52 | - FAIL_IF_NOT_ONLINE(hSession); | ||
53 | - | ||
54 | debug("%s",__FUNCTION__); | 52 | debug("%s",__FUNCTION__); |
55 | debug("Session lock state is %d",lib3270_get_lock_status(hSession)); | 53 | debug("Session lock state is %d",lib3270_get_lock_status(hSession)); |
56 | 54 |
src/testprogram/testprogram.c
@@ -62,6 +62,16 @@ static void online_group_state_changed(H3270 GNUC_UNUSED(*hSession), void GNUC_U | @@ -62,6 +62,16 @@ static void online_group_state_changed(H3270 GNUC_UNUSED(*hSession), void GNUC_U | ||
62 | printf("\n\n%s\n\n",__FUNCTION__); | 62 | printf("\n\n%s\n\n",__FUNCTION__); |
63 | } | 63 | } |
64 | 64 | ||
65 | +static void reconnect_test(H3270 *hSession) { | ||
66 | + | ||
67 | + lib3270_reconnect(hSession,0); | ||
68 | + | ||
69 | + int rc = lib3270_wait_for_ready(hSession,10); | ||
70 | + | ||
71 | + printf("\n\nlib3270_wait_for_ready exits with rc %d (%s)\n\n",rc,strerror(rc)); | ||
72 | + | ||
73 | +} | ||
74 | + | ||
65 | int main(int argc, char *argv[]) | 75 | int main(int argc, char *argv[]) |
66 | { | 76 | { |
67 | #ifdef _WIN32 | 77 | #ifdef _WIN32 |
@@ -80,6 +90,7 @@ int main(int argc, char *argv[]) | @@ -80,6 +90,7 @@ int main(int argc, char *argv[]) | ||
80 | { "crl", required_argument, 0, 'C' }, | 90 | { "crl", required_argument, 0, 'C' }, |
81 | { "url", required_argument, 0, 'U' }, | 91 | { "url", required_argument, 0, 'U' }, |
82 | { "tracefile", required_argument, 0, 't' }, | 92 | { "tracefile", required_argument, 0, 't' }, |
93 | + { "reconnect", no_argument, 0, 'r' }, | ||
83 | 94 | ||
84 | { 0, 0, 0, 0} | 95 | { 0, 0, 0, 0} |
85 | 96 | ||
@@ -103,7 +114,7 @@ int main(int argc, char *argv[]) | @@ -103,7 +114,7 @@ int main(int argc, char *argv[]) | ||
103 | 114 | ||
104 | int long_index =0; | 115 | int long_index =0; |
105 | int opt; | 116 | int opt; |
106 | - while((opt = getopt_long(argc, argv, "C:U:t:", options, &long_index )) != -1) { | 117 | + while((opt = getopt_long(argc, argv, "C:U:t:r", options, &long_index )) != -1) { |
107 | switch(opt) { | 118 | switch(opt) { |
108 | case 'U': | 119 | case 'U': |
109 | lib3270_set_url(h,optarg); | 120 | lib3270_set_url(h,optarg); |
@@ -113,6 +124,10 @@ int main(int argc, char *argv[]) | @@ -113,6 +124,10 @@ int main(int argc, char *argv[]) | ||
113 | lib3270_crl_set_url(h,optarg); | 124 | lib3270_crl_set_url(h,optarg); |
114 | break; | 125 | break; |
115 | 126 | ||
127 | + case 'r': | ||
128 | + reconnect_test(h); | ||
129 | + return 0; | ||
130 | + | ||
116 | case 't': | 131 | case 't': |
117 | trace_file = optarg; | 132 | trace_file = optarg; |
118 | lib3270_set_trace_handler(h,write_trace,NULL); | 133 | lib3270_set_trace_handler(h,write_trace,NULL); |