* Reduce latency of connect #1430
* Add a Windows implementation of socketpair
* Change type of interrupt sockets from int to SOCKET
* Clean up the connect latency reduction fixes#1430
```
ClCompile:
SSLSocket.c
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(43): warning C4005: 'EINTR': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(31): see previous definition of 'EINTR'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(50): warning C4005: 'EAGAIN': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(29): see previous definition of 'EAGAIN'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(100): warning C4005: 'ECONNRESET': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(39): see previous definition of 'ECONNRESET'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(104): warning C4005: 'EINPROGRESS': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(33): see previous definition of 'EINPROGRESS'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(118): warning C4005: 'ENOTCONN': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(37): see previous definition of 'ENOTCONN'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(130): warning C4005: 'ETIMEDOUT': macro redefinition
C:\Projects\paho.mqtt.c\src\Thread.h(35): see previous definition of 'ETIMEDOUT'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h(132): warning C4005: 'EWOULDBLOCK': macro redefinition
C:\Projects\paho.mqtt.c\src\Socket.h(35): see previous definition of 'EWOULDBLOCK'
```
Reason is that VS2010 (implicitly) includes errno.h by inclusion of openssl/err.h, hence after inclusion of Socket.h. Whereas, VS2015 (implicitly) includes errno.h by inclusion of SocketBuffer.h, hence before Socket.h.
Hint: Compilation with `/showIncludes` reveals the inclusion hierarchy.
Signed-off-by: tbeu <tc@tbeu.de>
closes: #166
This patch provides an initial implementation for websocket support for
paho. For the websocket specification see RFC 6455. The purpose of this
patch is to allow connnecting to an MQTT broker listening on a websocket
port (typically 80 [HTTP] or 443 [HTTPS]) to be able to communicate with
a client using the paho library. Using websockets to communicate increases
the packet overhead both sending and receiving as well as additional setup
and ping packets. However, using websockets allows for communications on
standard HTTP/HTTPS ports which are generally already configured by
firewalls to allow outside communications.
To use websockets, prefix the connection URI with either: "ws://" or
"wss://" for either websockets or secure websockets, repectfully.
Signed-off-by: Keith Holman <keith.holman@windriver.com>
To avoid inconsitstant definition of "bool", the definition of
mutex_type is moved into its own header file. This way, Socket.h does
not need to include Thread.h.
Signed-off-by: Juergen Kosel <juergen.kosel@softing.com>
To reduce the performance penalty of commit 779ca42a46
Ian has recommended to release the socket_mutex during the call of select.
See https://github.com/eclipse/paho.mqtt.c/issues/385#issuecomment-372299490
As a preparation for this, the locking of the socket_mutex is moved inside
the Socket_getReadySocket() function.
Signed-off-by: Juergen Kosel <juergen.kosel@softing.com>