X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test.c;h=0eb8462b4b60f26a17c87860384d238500748db8;hb=2049874f3c436cc1d85bb8bcccb272a3b933f4a9;hp=8ad46c63f49eada35109e303582ed121e8444953;hpb=13698a983ab7e44e523f1b914c56dc0bbe883c4f;p=utcp diff --git a/test.c b/test.c index 8ad46c6..0eb8462 100644 --- a/test.c +++ b/test.c @@ -39,6 +39,7 @@ ssize_t do_recv(struct utcp_connection *c, const void *data, size_t len) { void do_accept(struct utcp_connection *nc, uint16_t port) { utcp_accept(nc, do_recv, NULL); c = nc; + utcp_set_accept_cb(c->utcp, NULL, NULL); } ssize_t do_send(struct utcp *utcp, const void *data, size_t len) { @@ -108,7 +109,7 @@ int main(int argc, char *argv[]) { char buf[102400]; struct timeval timeout = utcp_timeout(u); - while(dir) { + while(!connected || utcp_is_active(u)) { size_t max = c ? utcp_get_sndbuf_free(c) : 0; if(max > sizeof buf) max = sizeof buf;