[Libevent-users] win32 iocp patch for libevent main trunk

liusifan liusifan at gmail.com
Fri Jun 13 11:27:04 EDT 2008


Hi,

I want to submit win32 iocp patch for main trunk ( with VS2008 ).

This one integerates the iocp backend into libevent's main trunk.

This one is passed mostly testcases in regress.c, except the following
http_suite, rpc_suite, test_edgetriggered, rpc_test.

The patch is in attachment. Include a diff file and win32iocp.c .
Compiles and works under VS2008, and it should compile and word under VC6.

The changes are:
1.Add a win32iocp.c, this file is implemented the iocp backend.
  It use a macro (_EVENT_NOIOCP) to disable iocp backend on the 
  platform which is not support iocp. iocp is only supported on NT4 and later.
2.Add EV_ACCEPT flag for accept event ( in include\event.h )
  #define EV_ACCEPT   0x40
3.Add win32iocpops into the eventops array ( in event.c ), 
  also use _EVENT_NOIOCP to guard.
4.Rename INPUT to EVRPC_INPUT and OUTPUT to EVRPC_INPUT ( in evrpc.h/evrpc.c )
  Because these two symbols are conflict with Windows SDK's header.
  
The full package:
http://spserver.googlecode.com/files/libevent-main-iocp.zip

Include:
1.libevent : library
2.regress : regress.c testcases
3.echo_test : an echo server, default listen on 5555
4.echo_stress : stress test tools for echo server

Stress Test Tools
Usage: echo_stress.exe [-h <host>] [-p <port>] [-c <clients>] [-m <messages>]
        -h default is 127.0.0.1
        -p default is 5555
        -c how many clients, default is 10
        -m messages per client, default is 10
        

c:\>echo_stress -c 10000 -m 1000

Test result :
Clients : 10000, Messages Per Client : 1000
ExecTimes: 927.078000 seconds

client Send Recv
total : 10000000 9999694
average : 10787/s 10786/s


Stephen Liu
2008-06-13
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WIN32-Code-IOCP.zip
Type: application/octet-stream
Size: 6027 bytes
Desc: not available
Url : http://monkeymail.org/archives/libevent-users/attachments/20080613/312e7be4/WIN32-Code-IOCP.obj


More information about the Libevent-users mailing list