Commit Graph

25 Commits

Author SHA1 Message Date
Andreas Hausladen
1f2895a469
Win wsa select event (#342)
* Fix #323: Missing SelectInterrupt implementation for Windows

Using WSAEventSelect, WSAWaitForMultipleEvents and WSAEnumNetworkEvents to emulate poll() with an interrupt-event.

* Cleanup

* Fixed incomplete comment.

* Switched ifdefs to support other Unixes with pipe file descriptors

* Fixed: SelectInterrupt fallback code for getFd()==-1 && getEvent()==nullptr converted a PollResultType::Timeout into a ReadyForRead causing the HttpClient to fail because it uses a hard-coded "SelectInterrupt" instance that doesn't implement getFd() and getEvent().

* Fixed gcc compile errors

* - HttpClient now uses the SelectInterruptFactory
- Fixed wrong ix::poll result when using Windows WSA functions

* We must deselect the networkevents from the socket event. Otherwise the socket will report states that aren't there.
2022-01-05 10:21:33 -08:00
CryptoManiac
47d0b70ebf
Include <cerrno> to provide standard error constants (#338)
See https://en.cppreference.com/w/cpp/header/cerrno for additional details. Some of used constants are defined in this header.

Inclusion is necessary to avoid these errors:

```
/home/user/IXWebSocket/ixwebsocket/IXNetSystem.cpp:189:30: error: use of undeclared identifier 'EAFNOSUPPORT'
            default: errno = EAFNOSUPPORT; return 0;
                             ^
/home/user/IXWebSocket/ixwebsocket/IXNetSystem.cpp:191:17: error: use of undeclared identifier 'ENOSPC'
        errno = ENOSPC;
                ^
/home/user/IXWebSocket/ixwebsocket/IXNetSystem.cpp:175:25: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long long') to 'int' [-Wshorten-64-to-32]
                    j = strspn(buf + i, ":0");
                      ~ ^~~~~~~~~~~~~~~~~~~~~
/home/user/IXWebSocket/ixwebsocket/IXNetSystem.cpp:234:21: error: use of undeclared identifier 'EAFNOSUPPORT'
            errno = EAFNOSUPPORT;
                    ^
2 warnings and 3 errors generated.
```
2022-01-04 12:13:19 -08:00
svost
5457217503
Improved compatibility - fix mingw crossbuild (#337) 2021-12-22 22:48:20 -08:00
ouwou
e66437b560
fix compilation under mingw64 (#325) 2021-11-16 15:22:51 -08:00
Enzo
3f1fc6906c
Correctly convert remote port bytecode to uint16 port number. (#321)
* Correctly convert remote port bytecode to uint16 port number.

Copied the network_to_host_short function from the ASIO library to convert the remote port byte code to a uint16 number.

* Switched from uint16_t to unsigned short to work in Windows

* Updated missed uint16_t to unsigned short
2021-10-22 10:23:43 -07:00
Benjamin Sergeant
0f21a20fe3 Move errno windows definitions to IXNetSystem.h 2021-05-17 19:04:02 -07:00
Benjamin Sergeant
24c2eae3d7 use inet_ntop and inet_pton musl implementations on all platforms 2021-03-23 20:53:19 -07:00
Benjamin Sergeant
b36a2d1faa mingw compile fix / remove restrict in inet_* functions 2021-03-19 10:58:38 -07:00
Benjamin Sergeant
0813eb1788 mention disablePerMessageDeflate in the doc 2021-03-16 09:56:08 -07:00
Benjamin Sergeant
7fd782f72f add WIN32_LEAN_AND_MEAN windows blip 2021-03-15 19:58:18 -07:00
Benjamin Sergeant
85bcdaaec3 stub inet_ntop and inet_pton function that mingw does not have 2021-03-14 14:25:40 -07:00
Benjamin Sergeant
78a670e0c8 more mingw quirks 2021-03-13 18:55:30 -08:00
Benjamin Sergeant
e63ac69ec6 mock poll struct and macro for mingw 2021-03-13 18:49:29 -08:00
Benjamin Sergeant
93ad709dfd fix ws curl error message + some Windows warnings 2020-12-12 11:01:22 -08:00
Benjamin Sergeant
6c205b983e (openssl tls) when OpenSSL is older than 1.1, register the crypto locking callback to be thread safe. Should fix lots of CI failures 2020-05-06 16:26:30 -07:00
tostc
7337ed34a6
Added asynchronous udp receive function (#193)
* Added asynchronous udp receive function

* Remove receive_async and added low level recv, which is non-blocking.

* Remove thread include

* Moved unix include to IXNetSystem.h
2020-05-05 07:47:41 -07:00
Benjamin Sergeant
c3a619f114 Add client support for websocket subprotocol. Look for the new addSubProtocol method for details 2019-10-13 13:37:34 -07:00
Benjamin Sergeant
b38e80f846 (freebsd compile fix) add some missing socket related headers 2019-10-09 15:38:40 -07:00
Benjamin Sergeant
7080c5679f move poll wrapper on top of select (only used on Windows) to the ix namespace 2019-09-08 11:15:08 -07:00
Benjamin Sergeant
ff75846d2d Windows: use select instead of WSAPoll, through a poll wrapper 2019-08-22 10:34:17 -07:00
Benjamin Sergeant
f78a3f88ff add poll alias to WSAPoll on Windows 2019-08-19 22:26:25 -07:00
Benjamin Sergeant
142987259c fix #101 / wrong include in IXSocket.cpp on Windows 2019-08-19 22:19:39 -07:00
Benjamin Sergeant
c65fec7271 clang format, based on cpprest 2019-05-30 08:46:50 -07:00
Dimon4eg
4fbc4e3be9 Fixes for windows (#45)
* init Net system on Windows

* propagate DNS error

* Add zlib 1.2.11 sources

* link zlib statically for windows

* remove not implemented function declaration

* fix connect on Windows
2019-04-25 16:26:53 -07:00
Benjamin Sergeant
9641c8cf49 header refactoring 2019-01-05 20:38:43 -08:00