Permalink
Browse files

add indicator

git-svn-id: http://svn.coderepos.org/share/lang/c/picoev/trunk@35014 d0d07461-0603-4401-acd4-de1884942a52
  • Loading branch information...
1 parent 9c81292 commit b7a830e5e60b693540a531596331143139b16cb4 kazuho committed Aug 24, 2009
Showing with 5 additions and 1 deletion.
  1. +1 −1 example/bench.c
  2. +4 −0 example/picoev_echo.c
View
@@ -216,7 +216,7 @@ run_once(void)
} while (count != fired);
gettimeofday(&te, NULL);
- //if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
+ if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
}
timersub(&te, &ta, &ta);
View
@@ -30,6 +30,7 @@
#include <assert.h>
#include <errno.h>
#include <netinet/in.h>
+#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/uio.h>
@@ -45,6 +46,7 @@ static void close_conn(picoev_loop* loop, int fd)
{
picoev_del(loop, fd);
close(fd);
+ printf("closed: %d\n", fd);
}
static void rw_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
@@ -86,6 +88,7 @@ static void accept_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
int newfd = accept(fd, NULL, NULL);
if (newfd != -1) {
+ printf("connected: %d\n", newfd);
picoev_add(loop, newfd, PICOEV_READ, TIMEOUT_SECS, rw_callback, NULL);
}
}
@@ -116,6 +119,7 @@ int main(void)
picoev_add(loop, listen_sock, PICOEV_READ, 0, accept_callback, NULL);
/* loop */
while (1) {
+ fputc('.', stdout); fflush(stdout);
picoev_loop_once(loop, 10);
}
/* cleanup */

0 comments on commit b7a830e

Please sign in to comment.