at 2011-11-24 16:38, debuguo said:
My test result is not only slow but also strange.
0.4 second at the most of the time, but sometimes it would be 3 sec.
I tried again, change loop count to a very big value, nowthe connect()
blocked 3 sec sometimes.
tcpdump shows somethings:
011-11-24 17:29:47
I cant explain why you test is so slow. But usually, we use socket in
non-blocking mode.
On server side, you should watch whether the listening socket is
readable,. when it's readable, you can non-blocking accept().
On client side, you should watch write event on the connecting socket.
when sock
Hello, everyone:
I am wonderring the performance of server written by libev, when the client
just do "connect" and "close".
the result is so special that I could not explain why.
here is the pseudocode for test.
*SERVER*:
> static void acceptcallback(...)
Hello, everyone:
I am wonderring the performance of server written by libev, when the client
just do "connect" and "close".
the result is so special that I could not explain why.
here is the pseudocode for test.
*SERVER*:
> static void acceptcallback(...)
{
clientfd = ac