git-svn-id: http://svn.openzap.org/svn/openzap/trunk@26 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2007-05-18 04:46:42 +00:00
parent a2485caac0
commit 5c59ad5abf
2 changed files with 15 additions and 10 deletions

View File

@ -24,15 +24,21 @@ int main(int argc, char *argv[])
printf("set interval failed\n");
}
for(x = 0; x < 25; x++) {
unsigned char buf[160];
unsigned char buf[80];
zap_size_t len = sizeof(buf);
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
printf("READ: %d\n", len);
zap_wait_flag_t flags = ZAP_READ;
zap_channel_wait(chan, &flags, 0);
if (flags & ZAP_READ) {
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
printf("READ: %d\n", len);
} else {
printf("READ FAIL! %d\n", len);
break;
}
} else {
printf("FAIL! %d\n", len);
break;
printf("wait fail\n");
}
}
}

View File

@ -326,8 +326,6 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait)
int s;
struct timeval tv, *tvp = NULL;
ZINT_WAIT_MUZZLE;
if (to) {
memset(&tv, 0, sizeof(tv));
tv.tv_sec = to / 1000;
@ -357,7 +355,7 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait)
*flags = ZAP_NO_FLAGS;
s = select(zchan->sockfd + 1, r, w, e, tvp);
if (s < 0) {
return ZAP_FAIL;
}
@ -411,6 +409,7 @@ static ZINT_READ_FUNCTION(wanpipe_read_unix)
*datalen = rx_len;
if (rx_len <= 0) {
perror("wtf");
return ZAP_FAIL;
}
@ -433,7 +432,7 @@ static ZINT_WRITE_FUNCTION(wanpipe_write_unix)
int bsent;
struct msghdr msg;
struct iovec iov[2];
wp_tdm_api_rx_hdr_t hdrframe;
wp_tdm_api_tx_hdr_t hdrframe;
memset(&msg, 0, sizeof(msg));
memset(&hdrframe, 0, sizeof(hdrframe));