Problem:
Conditional logic in check_protocol() that checks if a protocol is supported,
is duplicated twice. Moreover, the first set of checks to ascertain if a
protocol is supported is done regardless of whether the particular protocol
will be built into the library or not.
Solution:
* Simplify/collapse all supported protocol checks into one in check_protocol()
* Enclose pgm/epgm/norm socket+protocol match checks with requisite macros
Move tests specific to Linux under a platform conditional thereby eliminating
unnecessary builds and fixing "make test" on Mac OS X and possibly other
non-Linux systems.
Tests specific to Linux:
- abstract namespace support for AF_UNIX sockets
- TIPC support (AF_TIPC)
Test success rate jumps from 90% to 100% on Mac OS X after this change.
Solution: return -1 (no event) instead of 0 (event)
For some reason, this just returns 0 if there are no sockets registered
on the poller. Usually this would mean there has been an event. So the
caller would have to check the return value AND the event, or write code
that takes the number of registered sockets into consideration.
By returning -1 and setting errno = ETIMEDOUT like in the usual timeout
cases, it's more consistent and convenient.
Test case included.
Solution: if options.use_fd do not create temporary random
directory for ipc://*, since the socket is already created and
passed to the library by the user.
Solution: use the less nice but correct int constant 1000000000
instead of the shorter 1E9 to avoid a compiler warning when assigning
to timespec.tv_nsec, which is a long int.
Solution: in the Windows-specific ifdef in tcp_listener set_address,
check for error and set errno only after the IPv4 fallback has failed
too, to avoid setting errno when the socket creation succeeds through
the fallback.
Solution: if opening an IPv6 TCP socket fails because IPv6 is not
available, try to open an IPv4 socket instead when creating and
connecting a TCP endpoint.
Solution: if opening an IPv6 TCP socket fails because IPv6 is not
available, try to open an IPv4 socket instead when creating and
binding a TCP endpoint.
Problem: Recent deprecation of the "zmq_utils.h" header file caused pedantic compilations (including czmq) to fail because non-portable #warning is used.
Solution: Limit the deprecation warnings to compilers known or assumed to support the "#pragma message" (GCC, MSVC, CLANG) and wrap with GCC directives to not treat these warnings as errors on paranoid builds.
Problem: Since pull request #1730 was merged, protocol for REQ socket is
checked at the session level and this check does not take into account
the possibility of a request_id being part of the message. Thus the option
ZMQ_REQ_CORRELATE would no longer work.
This is now fixed: the possiblity of a 4 bytes integer being present
before the delimiter frame is taken into account (whether or not this
breaks the REQ/REP RFC is another issue).
A Visual Studio build from master (commit id: dac5b45dfb) using the v140_xp toolset yields a binary that is not XP compatible.
Two libraries contain exports that cannot be found:
- IPHLPAPI.DLL : if_nametoindex
- KERNEL32.DLL : InitializeConditionVariable
The latter export is already dealt with in the file './src/condition_variable.hpp'; however this requires setting the _WIN32_WINNT pre-processor definition.
I am not experienced enough to figure a work around for the 'if_nametoindex' method, so I have created a new pre-processor definition 'ZMQ_HAVE_WINDOWS_TARGET_XP' and removed the calling of the function with the limitation that these builds cannot handle a IPv6 address with an adapter name.
To make it easier for people targeting XP with an MSVC build I have modified the MSBuild property file to add/modify the pre-processor definitions if they are building using a XP targeting tool set; such as v140_xp.
* Added a new .gitignore file for excluding Visual Studio build output any popular plug-in generated content. (This was copied from the GitHub project https://github.com/github/gitignore).
* Removed the basic ignore settings from the root folder in favour of more precision within the subfolder's .gitignore file
* Added the new VC compiler's experimental Intellisense database file
All the older (vs2010 -> vs2013) projects had copies of the Visual Studio 2015 MSBuild applied to them when running the 'configure.bat' batch file. Any modifications to a property sheet was not applied to the other Visual Studio versions' projects unless the batch file was re-executed.
* Modified the older projects to reference the Visual Studio 2015 property sheets so changes are immediately applied
* Removed the batch file copy steps (which left the repository very dirty after execution)