simplex-chat / simplexmq

⚙️ SimpleXMQ - A reference implementation of the SimpleX Messaging Protocol for simplex queues over public networks.
https://simplex.chat
GNU Affero General Public License v3.0
542 stars 62 forks source link

Fix the build on OpenBSD #1273

Closed daviduhden closed 1 month ago

daviduhden commented 3 months ago

SimpleXMQ utilizes specific Linux TCP socket options [^1] that are not available in OpenBSD [^2], namely, TCP_KEEPIDLE, TCP_KEEPINTVL, and TCP_KEEPCNT. The absence of these options prevents the successful building of SimpleXMQ on OpenBSD. This change addresses this issue. Additionally, I have attempted to link the binaries with OpenSSL 1.1.1, which is available in the ports tree, by adding the location of these libraries to a cabal.project.local file. However, I have been unable to correctly link the binaries with these libraries, encountering persistent errors related to the libraries failing to load. Nevertheless, it is possible to compile SimpleXMQ with the latest version of LibreSSL without any errors.

[^1]: Linux TCP man page [^2]: OpenBSD TCP man page

daviduhden commented 2 months ago

The issue with the missing TCP socket options—TCP_KEEPIDLE, TCP_KEEPINTVL, and TCP_KEEPCNT—is specific to the OpenBSD TCP stack. Other UNIX-like operating systems, such as FreeBSD [^1], NetBSD [^2], DragonFlyBSD [^3], and even illumos-based systems [^4] (the successor of OpenSolaris), support these options in their TCP stacks.

[^1]: FreeBSD TCP man page [^2]: NetBSD TCP man page [^3]: DragonFlyBSD TCP man page [^4]: illumos TCP man page