[Libwebsockets] i686-w64-mingw32 and Windows 7 (64bit): WSAPoll fails

"Andy Green (林安廸)" andy at warmcat.com
Sat Mar 9 01:45:49 CET 2013

On 09/03/13 04:28, the mail apparently from Arokux B. included:
> On Tue, Mar 5, 2013 at 1:37 AM, "Andy Green (林安廸)" <andy at warmcat.com> wrote:
>> On 05/03/13 01:22, the mail apparently from Arokux B. included:
>>> Hello,
>>> it would be nice to add some error handling after a call to the poll.
>>> On Windows 7 (64bit), libwebsockets library compiled with
>>> i686-w64-mingw32 toolchain does not work. The example
>>> libwebsockets-test-server.exe returns immediately, due to -1 return
>>> value from libwebsocket_service and in turn from poll. I've digged a
>>> bit into it. The _WIN32 is defined, and the module Ws2_32.dll exists,
>>> getting an address to WSAPoll also succseeded. So as poll, WSAPoll is
>>> used.
>>> However a call to poll (that is WSAPoll) returns -1, and printing
>>> WSAGetLastError gives 10022, which means WSAEINVAL (Invalid argument).
>>> After falling to the emulated poll, the example works, so I can use
>>> this as a workaround.
>>> Unfortunately I have very limited knowledge of Windows platform, so if
>>> you want me to test it further, you'd need to give me precise
>>> directions.
>> Likewise, I have no idea about that.
>> However I know it's workable for Visual Studio build with Joakim's CMake, so
>> I guess either everyone meets this and doesn't care, or the visual studio
>> build doesn't experience the problem.
>> Are people building for Visual Studio seeing this problem?  If so we can
>> just use the emulated poll from the get-go.
>> -Andy
> Hi,
> do not ask me why, but WSAPoll works now. Tested on Win XP on bare
> hardware, Win7 (64bit, VirtualBox).

OK, thanks for letting us know.  I'll ignore that then.


More information about the Libwebsockets mailing list