Commit Graph

46 Commits

Author SHA1 Message Date
Sven Trittler 6affc7809d
fix qnx compile errors 2026-02-16 17:03:00 +00:00
Ian Craggs 375e76d86a
Reduce latency on connect #1430 (#1642)
* 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
2026-02-10 17:54:00 +00:00
Ian Craggs c484bd985d
Update copyright statement dates 2026-01-29 16:31:04 +00:00
fpagliughi b90a389380 Removed the mutex_type.h header; merged mutex into Thread.h 2026-01-10 09:48:01 -05:00
fpagliughi 1bb2e691e1 - Removed unnecessary _WIN64 conditional checks
- Fixed some conditional compilation using (WIN32) to (_WIN32)
2025-01-09 16:09:38 -05:00
fpagliughi cd2d10b650 Added support for UNIX-domain sockets for v1.3.x 2025-01-02 17:21:51 -05:00
Ian Craggs 0465673753 Ping processing when sockets being used by large messages 2022-07-02 13:22:23 +01:00
Ian Craggs 56c6151e9b Fix some timing issues in some scenarios for the poll implementation 2022-05-26 21:26:39 +01:00
Ian Craggs 90c3916819 Allow old select code to be used optionally 2022-02-11 15:55:52 +00:00
Ian Craggs 34f8c52d42 Fix some errors in the poll implementation 2022-02-05 18:27:59 +00:00
Ian Craggs a43528ba96 Use poll instead of select #1033 2022-02-04 17:23:56 +00:00
vm-vloz fadf34d1e5 Fix disconnect when there are pending writes
Signed-off-by: vm-vloz <73361520+vm-vloz@users.noreply.github.com>
2021-07-26 18:51:32 -07:00
Sandro Scherer 6318369632 handle ssl errors when processing buffered data
Signed-off-by: Sandro Scherer <sand.scherer@gmail.com>
2020-10-15 13:53:04 +02:00
Ian Craggs 86938878ef Add stdint header for Windows 2020-07-23 21:38:20 +01:00
Ian Craggs 9ab83100a8 Gather packet buffer data into a structure and record websocket mask used 2020-07-23 16:05:34 +01:00
Ian Craggs 55096c080c Stop loop on socket close in Websockets #916 2020-07-01 20:05:16 +01:00
Ian Craggs 1e91229cb6 Update license from EPL v1 to v2 2020-04-06 13:27:50 +01:00
fpagliughi fbd38b16cf
#368 Add underscores to Windows compiler macro checks, _WIN32 and _WIN64
Signed-off-by: fpagliughi <fpagliughi@mindspring.com>
2020-01-25 10:38:18 -05:00
Ian Craggs 7a5a5ae225 Merge branch 'develop' of github.com:eclipse/paho.mqtt.c into develop 2019-12-04 16:15:38 +00:00
Ian Craggs 21ffebcb74 Merge branch 'develop' of https://github.com/CJxD/paho.mqtt.c into CJxD-develop #165 2019-12-04 16:13:48 +00:00
tbeu 6bc3ec63bd Fix VS2010 macro redefinition warnings
```
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>
2019-11-26 20:49:13 +01:00
Keith Holman 086111f1dd WebSocket: initial websocket support + utilities
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>
2018-05-02 16:59:25 -04:00
Juergen Kosel 231eda090d Move definition of mutex_type into own header file
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>
2018-03-13 08:37:24 +01:00
Juergen Kosel e858851455 Modify order of includes to fix travis build
Signed-off-by: Juergen Kosel <juergen.kosel@softing.com>
2018-03-12 16:49:27 +01:00
Juergen Kosel 2d25517408 Lock the socket_mutex inside Socket_getReadySocket()
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>
2018-03-12 14:46:15 +01:00
Ian Craggs cb8d4b703b Make sure writeComplete deals with socket error #373 2017-12-04 11:19:48 +00:00
Rainer Poisel a16cff63cc Compile support for VxWorks 6.9
Signed-off-by: Rainer Poisel <rainer.poisel@logicals.com>
2017-07-08 23:51:17 +02:00
Ian Craggs b880d34f4b Windows CMake build additions and corrections 2017-03-20 22:47:28 +00:00
Guilherme Maciel Ferreira 009fd7bf6e Add missing function prototypes
Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2017-03-06 11:55:19 -06:00
Chris Watts aff3474924 Prevent use of getaddrinfo_a() on OSX
Signed-off-by: Chris Watts <chris@cjwatts.com>
2016-08-01 19:55:11 -07:00
Chris Watts ba897c9e94 Include getaddrinfo() in the connection timeout (only works with GNU)
Signed-off-by: Chris Watts <chris@cjwatts.com>
2016-08-01 19:42:52 -07:00
Ian Craggs 2912e2b93d Fix compile warnings in 64 bit builds & make debug builds work properly
Bug: 480160, 443722
2015-11-04 22:08:02 +00:00
Ian Craggs 9aafd033ab Define ETIMEDOUT on Windows 2014-08-28 14:29:41 +01:00
Ian Craggs fa781a1ab9 Correct source file modes 2014-08-22 16:19:17 +01:00
rxiang 96faf843fc 43204 review
Signed-off-by: rxiang <xiangr@cn.ibm.com>
2014-07-07 03:11:51 +08:00
Ian Craggs 3b79c88c08 Merge ssh://git.eclipse.org:29418/paho/org.eclipse.paho.mqtt.c into develop
Conflicts:
	src/MQTTAsync.c
	src/MQTTClient.c
	src/MQTTProtocolOut.c
2014-05-29 13:46:25 +01:00
Ian Craggs 0206989e82 Remove OSX compile warnings 2014-05-08 14:39:33 +01:00
Ian Craggs 33c5108b69 Remove OSX compiler warnings 2014-05-08 14:14:39 +01:00
Ian Craggs 2380b26dfb Add WIN64 to WIN32 conditional compilation statements 2014-04-10 14:41:57 +01:00
Ian Craggs fa68280d04 Fix buffering of connect packet 2014-03-12 15:45:22 +00:00
Ian Craggs 1359abddb5 Fix Windows compile warnings 2013-09-10 16:23:12 +01:00
Ian Craggs 9af36c8047 Add notices for dual epl/edl licensing 2013-03-18 15:32:53 +00:00
Ian Craggs fef7f88070 Bug #402245: pings sent unnecessarily and messages can be reordered 2013-03-03 19:57:39 +00:00
Ian Craggs c67fff6c6a Fix compile warnings 2013-01-24 16:39:41 +00:00
Ian Craggs 97c7280470 New asynchronous MQTT API (see MQTTAsync.h) and
SSL support for both old and new APIs.
2013-01-24 14:40:11 +00:00
Ian Craggs 76d745098e The rest of the initial release commit 2012-03-08 23:33:18 +00:00