diff --git a/src/misc.cc b/src/misc.cc index 2a2fbe3..3c4cebb 100644 --- a/src/misc.cc +++ b/src/misc.cc @@ -39,11 +39,11 @@ PHP_METHOD(tn3270, connect) { const char * host; int szHost; - zend_bool wait = 0; + long wait; int rc = 0; tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &host, &szHost, &wait) == FAILURE) + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &host, &szHost, &wait) == FAILURE) RETURN_NULL(); if(szHost) @@ -51,7 +51,7 @@ PHP_METHOD(tn3270, connect) char text[szHost+1]; strncpy(text,host,szHost); text[szHost] = 0; - rc = obj->hSession->connect(text,wait); + rc = obj->hSession->connect(text,(int) wait); } else { diff --git a/testprograms/connect.php b/testprograms/connect.php new file mode 100644 index 0000000..3a845e3 --- /dev/null +++ b/testprograms/connect.php @@ -0,0 +1,21 @@ +connect("tn3270://fandezhi.efglobe.com:23",10); + if($rc != 0) { + die("Connection failed, rc=" . $rc . "\n"); + } + + $rc = $host->waitforready(10); + if($rc != 0) { + die("Host is not ready, rc=" . $rc . "\n"); + } + + $host->disconnect(); + + die("Success!!\n"); + +?> -- libgit2 0.21.2