Commit Graph

82 Commits

Author SHA1 Message Date
Luca Boccassi
0f706bdd97 Problem: formatting errors
Solution: run make clang-format-diff
2021-09-22 16:40:17 +01:00
Andrij Abyzov
04761133bf Fix zmq::select_t::loop formatting 2019-11-20 09:29:59 +01:00
Luca Boccassi
9ced36e407 Problem: WSAEventSelect checks for FD_OOB, but select does not
WSAEventSelect is used on Windows (when select is the polling method)
only if waiting for more than one socket family, excluding IPv4/6.
It is then passed FD_OOB, which means it can be woken by OOB messages,
but select later on never checks for it.
Remove FD_OOB as it's not actually used for anything.
2019-11-01 09:34:03 +00:00
Simon Giesecke
36d265ee7d Problem: redundant parentheses in return statements
Solution: remove them
2019-03-01 05:46:10 -05:00
Simon Giesecke
e3c73d9881 Problem: inconsistent naming style for private data members, conflicts with naming of local variables and member functions
Solution: apply and check _lower_case naming style for private data members
2018-05-27 13:24:07 +02:00
Simon Giesecke
12a97bb769 Problem: redundant else after return
Solution: remove else
2018-05-26 09:34:45 +02:00
Simon Giesecke
c581f43c97 Problem: parameter naming style inconsistent
Solution: define and apply parameter naming style: lower_case_
2018-05-26 09:34:44 +02:00
Simon Giesecke
d326434b37 Problem: API poller cannot be set independently from I/O thread poller, poll I/O thread poller broken on Windows
Solution: change platform definitions to separate API poller from I/O thread poller, disallow configuring poll I/O thread poller on Windows
2018-05-22 18:36:04 +02:00
Simon Giesecke
4e616f30dd Problem: C-style casts used
Solution: replace by C++-style casts
2018-05-18 17:04:01 +02:00
Manuel Segura
4726f7262d Pull request to merge porting to WindRiver VxWorks 6.x (#2966)
* Problem: Still need to port over more files to VxWorks 6.x

Solution: Port more files to VxWorks 6.x

* Problem: Need to port over remaining files to VxWorks 6.x. Also remove POSIX thread dependency for VxWorks (because of priority inversion problem in POSIX mutexes with VxWorks 6.x processes)

Solution: Port over remaining files to VxWorks 6.x. Also removed POSIX thread dependency for VxWorks

* Problem: Needed to modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x.

Solution:  Modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x
2018-03-10 11:03:02 +00:00
Simon Giesecke
94743fd21f Problem: wrong formatting in several files
Solution: apply clang-format
2018-02-13 18:40:43 +01:00
Simon Giesecke
c62574ffca Problem: segfault in select_t::trigger_events
Solution: fixed access to stale vector
2018-02-12 14:42:46 +01:00
Simon Giesecke
11a5388637 Problem: data race w.r.t. select_t::stopping
Solution: change termination condition of select_t
2018-02-12 14:42:33 +01:00
Simon Giesecke
08201bc1b9 Problem: select blocks forever under Unix
Solution: fixed call of select, and initialization of poll_t members
2018-02-12 14:39:02 +01:00
Luca Boccassi
a30133d8f5
Merge pull request #2935 from ZMQers/unity-base
Problem: no test framework, no unit tests
2018-02-12 11:01:08 +00:00
Luca Boccassi
d0e01b4bb2 Problem: regression with "select" on *nix (#2940)
* Problem: build failure with select as polling mechanism

Solution: cast mailbox_handle argument to (poller_t::handle_t) like in
the reaper thread class.

* Problem: build failure due to INT_MAX use without include

Solution: include limits and climits in src/select.cpp where INT_MAX is
used

* Problem: build failure due to unused variable in select.cpp

Solution: move the declaration of int rc inside the ifdef block where
it is actually used

* Problem: reference to wrong variable in select.cpp breaks build

Solution: fix it

* Problem: family_entry_t constructor has no body, build fails on *nix

Solution: add empty inline function in the struct

* Problem: no test coverage for poll and select

Solution: add Travis jobs for them on Linux

* Problem: Travis jobs cannot run in container infra

Solution: set sudo: false as it is not required anymore
2018-02-12 03:01:03 -05:00
Simon Giesecke
f87d3ab294 Problem: pollers unnecessarily depend on whole ctx_t, but actually use only start_thread method
Solution: extract thread_ctx_t from ctx_t
2018-02-11 17:25:36 +00:00
sigiesec
88d8c768d1 Problem: test_timers frequently fails on travis-ci
Solution: relaxed test assertions, based on the actual time passed,
instead of assuming that this equals to the time slept
2018-02-09 09:55:40 +01:00
Simon Giesecke
3baefc66ea Problem: incomplete assertions around modifications of fd_entries vs.
load

Solution: add assertions, partially in debug build only, improved naming
2018-02-09 09:53:02 +01:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
sigiesec
206c832167 Problem: in case of exhausted resources on creation of a context, assertions are triggered
Solution: signal error to caller, and apply appropriate cleanup
2018-01-31 20:53:06 +01:00
sigiesec
f9d7eea6f9 Problem: code duplication
Solution: unified Windows & non-Windows code further
2017-10-26 11:05:39 +02:00
sigiesec
e7817ad38d Problem: code duplication
Solution: reduced code duplication by introducing local variables and
new function trigger_events
2017-10-26 10:47:05 +02:00
sigiesec
37914d1be2 Problem: get_fd_family call is expensive and called frequently for the
same fds

Solution: cache results of get_fd_family
2017-10-26 09:46:11 +02:00
sigiesec
cd32603c0e Problem: wsa_events are initialized/destroyed within every loop
iteration even if not used

Solution: Move wsa_events closer to usage
2017-10-25 18:30:03 +02:00
sigiesec
eb8105cde1 Problem: assertion failure in select.cpp:111 under Windows
Solution: handle case when get_fd_family fails
2017-09-01 11:55:31 +02:00
sigiesec
c3c2515542 Problem: code duplication within zmq::select_t::rm_fd
Solution: extract find_fd_entry_by_handle from rm_fd
2017-08-21 14:36:50 +02:00
bjovke
dc7bbe35b4 Problem: FD set copying on Windows still not optimal on some places. Solution: Improved memcpy() of FD sets for Windows builds. 2017-04-14 16:31:05 +02:00
Luca Boccassi
121c9d16f5 Problem: select.cpp/hpp build fails with reorder error
Solution: initialise class variables in the same order they are
declared
2016-11-24 13:07:47 +00:00
Ilya Kulakov
06614a394d Fix fd_entry may reference invalid object.
fd_entries (std::vector) can reallocate underlying storage
which will render reference invalid.
2016-09-24 21:17:32 -07:00
Gennady Makovetski
2e3888dd45 Problem: Pub socket crashes on client disconnect. family_entry.fd_entries [i] is modified in zmq::select_t::rm_fd()
Solution: do not copy family_entry.fd_entries [i]
2016-09-23 15:26:36 +03:00
Constantin Rack
022cf2aeaa Problem: source code contains tabs
Solution: replace tabes with spaces
2016-09-17 08:44:00 +02:00
Luca Boccassi
a343059aad Merge pull request #2041 from packetstash/select-fix-rebased
Copy instead of reference to a vector that gets reallocated.
2016-06-16 22:48:36 +01:00
Douglas Cuthbertson
4019112a82 Copy instead of reference to a vector that gets reallocated. 2016-06-16 17:34:22 -04:00
Yann Diorcet
9835e18f64 Fix compilation with mingw64 using autotools 2016-06-01 15:07:16 +02:00
evoskuil
2b798e486a Problem: name conflicts from windows.h, draft API declared in pch. 2016-05-13 20:41:26 -07:00
hitstergtd
b2d0ab18f2 Problem: trailing whitespace in code
Solution: fix them
2016-04-25 12:18:46 +01:00
hitstergtd
a4b426b18e Problem: typos/trailing spaces in code comments
Solution: fix them
2016-04-25 11:16:26 +01:00
Doron Somech
87e455f59b Fix UDP failing on windows 2016-04-21 14:00:02 +03:00
Mário Kašuba
75579fe7d9 Added comment to sockaddr_storage 2016-03-19 14:49:22 +01:00
Mário Kašuba
e38166cc1b Use sockaddr_storage instead of sockaddr to support IPv6 addresses 2016-03-19 14:37:10 +01:00
Osiris
4a5af9d58b Problem: Precompiled headers not being used
Solution: Phase I - make precompiled.hpp be first file included in every source file
2016-02-18 10:56:52 -06:00
Michael
56efddd182 remove c++11 requirement and -Werror=sign-compare
used static_cast<signed int> around WSA_WAIT_FAILED as it is an unsigned implicitly defined as (0xFFFFFFFF ion winbase.h) and causes a comparison error.

removed use of c++11 style initialiser list for 'sockaddr addr { 0 }' and changed it to 'sockaddr addr = { 0 }'
2016-02-06 22:55:24 +11:00
Pieter Hintjens
3d9984efe2 Merge pull request #1764 from GreatFruitOmsk/master
Make VMCI work on Windows
2016-02-03 16:21:53 +01:00
Ilya Kulakov
538e5d4742 Make VMCI to work on Windows.
select was improved to support multiple service providers on Windows.
it should be slightly faster because of optimized iteration
over selected sockets.
2016-02-03 19:12:11 +06:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
Huu Nguyen
5642366f10 Fix non-constant-expression narrowing
For OS X, the microseconds field is implemented as an int type. The implicit narrowing in the initializer list throws a compiler error for some compilers with C++11 support turned on. The specific error message is: "error: non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]".

Tested on Clang 5.1.0 and Mac OS X 10.9.4.
2014-09-16 14:34:11 -07:00
Joel Lauener
219310b4f0 Thread scheduling parameters: Use ZMQ context options instead of
environment variables.
2014-07-02 14:41:21 +02:00