[Libevent-users] a question of evbuffer_pullup

2012-08-23 Thread simon zhang
I don't understand “must first ensure that the front of the buffer
really is contiguous”.

I can get 100 bytes from evbuffer by evbuffer_pullup() or evbuffer_remove().
evbuffer_pullup():get some contiguous data.
evbuffer_remove():get some discontinuous data???

Some discontinuous data??Why we need this.We can't handle some
discontinuous data.
***
To unsubscribe, send an e-mail to majord...@freehaven.net with
unsubscribe libevent-usersin the body.


[Libevent-users] Can the pipe be used in event_new function as file descriptor(evutil_socket_t) in windows?

2013-01-09 Thread simon zhang
I wanted some linux code work in the windows.This is a multi
thread program.I hope that the parent thread and child thread to pass data
through the pipe.
But no file descriptor in windows.The CreatePipe function can creat a pipe
with read HANDLE and write HANDLE.But libevent don't konw HANDLE.I can not
use it in the event.
What is good way?Can't the pipe be used?


Re: [Libevent-users] some static compiled error in mingw+msys

2013-01-11 Thread simon zhang
Thank you.It was compiled successfully.

2013/1/12 Dodd, Timothy 

> Looks like you need to link against the winsock library (Ws2_32.lib).
>
> tim
>
> From: simon zhang 
> Reply-To: "libevent-us...@freehaven.net" 
> Date: Friday, January 11, 2013 2:28 PM
> To: "libevent-us...@freehaven.net" 
> Subject: [Libevent-users] some static compiled error in mingw+msys
>
> Hi all.
> I have writed a python expanded in winxp with mingw+msys compiled.It will
> call libevent lib.I hope that user don't install more library,so I want
> to compile it statically.But there are some error.I describe the process.
>
> compile and install libevent:
>
>> ./configure -prefix=D:/libevent -enable-static
>> make
>> make install
>
>
> makefile 1:
>
>> HEAD_PATH_FLAGS=-IC:/Python27/include -ID:/boost/include/boost-1_52
>> -ID:/libevent/include
>> LIB_PATH_FLAGS=-LD:/boost/lib -LD:/libevent/lib -LC:/Python27/libs
>> LIB_FLAGS=-lboost_python-mgw46-s-1_52 -Wl,Bstatic -levent -Wl,Bdynamic
>> -lpython27 -lwsock32
>> SOURCE=test.o
>> all:${SOURCE}
>> g++ ${HEAD_PATH_FLAGS} ${SOURCE} ${LIB_PATH_FLAG} ${LIB_FLAGS} -fPIC
>> -shared -o test.dll
>
>
> makefile 2:
>
>> HEAD_PATH_FLAGS=-IC:/Python27/include -ID:/boost/include/boost-1_52
>> -ID:/libevent/include
>> LIB_PATH_FLAGS=-LD:/boost/lib -LD:/libevent/lib -LC:/Python27/libs
>> LIB_FLAGS=-lboost_python-mgw46-s-1_52 -lpython27 -lwsock32
>> SOURCE=test.o D:/libevent/lib/libevent.a
>> all:${SOURCE}
>> g++ ${HEAD_PATH_FLAGS} ${SOURCE} ${LIB_PATH_FLAG} ${LIB_FLAGS} -fPIC
>> -shared -o test.dll
>
>
> I have writed two makefile and do the same error.
>
>> libevent.a(buffer.o):In function 'evbuffer_read':undefined reference to
>> 'WSARecv@28'
>> libevent.a(buffer.o):In function 'evbuffer_write_iovec':undefined
>> reference to 'WSASend@28'
>> 
>
>
> Why?How to compile it rightly.
>
>


[Libevent-users] some error about evsig_init in winxp.

2013-01-14 Thread simon zhang
I compile the code as DLL in winxp with libevent.The compiler is msvc90.But
It have some error as the following:

evsig_init:socketpair:Successful WSAStartup not yet performed
[WSANOTINITIALISED]

How to make it work correctly?
I have tried to compile in mingw and have the same error.
The dll is a module of python.


Re: [Libevent-users] some error about evsig_init in winxp.

2013-01-14 Thread simon zhang
Thank you.I have make it work in winxp.

2013/1/15 Dodd, Timothy 

> That is a runtime error, right?  You need to initialize windsock before
> using it.  See, for example:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms738566(v=vs.85).aspx.
>  There's documentation on runtime winsock errors here:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
> .
>
> Hope this helps,
> Tim
>
> From: simon zhang 
> Reply-To: "libevent-us...@freehaven.net" 
> Date: Monday, January 14, 2013 12:48 PM
> To: "libevent-us...@freehaven.net" 
> Subject: [Libevent-users] some error about evsig_init in winxp.
>
> I compile the code as DLL in winxp with libevent.The compiler is
> msvc90.But It have some error as the following:
>
> evsig_init:socketpair:Successful WSAStartup not yet performed
> [WSANOTINITIALISED]
>
> How to make it work correctly?
> I have tried to compile in mingw and have the same error.
> The dll is a module of python.
>