Commit Graph

22 Commits

Author SHA1 Message Date
Ian Barber
dde69fb9fb Revert "Merge branch 'master' of github.com:zeromq/libzmq"
This reverts commit 7b10586558, reversing
changes made to 3345902979.
2012-06-12 14:12:03 +01:00
Martin Hurton
3ec8e576d9 Fix race conditions in {tcp,ipc}_connecter
Once the object has been terminated, it is unsafe for this object
to refer to its parent.

The bug was responsible for occasional
test_shutdown_stress failures.
2012-06-12 01:47:31 +02:00
AJ Lewis
97c48ccda6 Fix build on HPUX 11iv3
The socket length variable for getsockname and accept must be an
(int *) instead of a (socklen_t *) on HPUX.

Signed-off-by: AJ Lewis <aj.lewis@quantum.com>
2012-06-05 09:44:02 -05:00
Lourens Naudé
5c6f72c17c ZMQ_MONITOR socket option registers a callback / event sink for changes in socket state 2012-05-04 02:32:46 +01:00
Sergey KHripchenko
057fab09a8 fixes for zmq_unbind() / zmq_disconnect() usage corner cases
1. when we call zmq_bind()/zmq_connect() to create endpoint
we send ourselfs(through launch_child()) command to process_own(endpoint)
(and add it to own_t::owned)
in the application thread we could call zmq_unbind() / zmq_disconnect() _BEFORE_
we run process_own() in ZMQ thread and in this situation we will be unable to find it in
own_t::owned. in other words own_t::owned.find(endpoint) will not be deleted but it will be deleted from
socket_base_t::endpoints.

2. when you zmq_unbind() the lisnening TCP/IPC socket was terminated only in destructor...
so the whole ZMQ_LINGER time listening TCP/IPC socket was able to accept() new connections
but unable to handle them.

this all geting even worse since unfortunately zmq has a bug and '*_listener_t' object not terminated
untill the socket's zmq_close().
AT LEAST FOR PUSH SOCKETS.
Everything is ok for SUB sockets.

Easy to reproduce without my fix:

zmq_socket(PUSH)
zmq_bind(tcp);
// connect to  it from PULL socket
zmq_unbind(tcp);

sleep(forever)

// netstat -anp | grep 'tcp listening socket'

With my fix you could see that after zmq_unbind(tcp) all previously connected tcp sessions
will not be finished untill the zmq_close(socket) regardless of ZMQ_LINGER value.

(*_listener_t terminates all owned session_base_t(connect=false) and they call pipe_t::terminate()
which in turn should call session_base_t::terminated() but this never happens)
2012-04-21 18:56:10 +04:00
Sergey KHripchenko
7b8e728e43 implement zmq_unbind(),zmq_disconnect(), zmq->sock->getsockopt(ZMQ_LAST_ENDPOINT_ID) 2012-04-18 23:42:11 +04:00
Rob Gagnon
3aabbbaefa Fix IPC transport domain socket stream file not being removed when connection is closed 2012-03-01 21:49:46 +00:00
Mikko Koppanen
d00d4843be More fixes for ZMQ_LAST_ENDPOINT. Added a test 2012-02-18 20:44:41 +00:00
Mikko Koppanen
56aa49ff3d Fix build on solaris 2012-02-17 21:45:17 +00:00
Staffan Gimåker
b9fb48f47b Resolve addresses in the calling thread on connect.
This allows us to actually report an error to the caller on resolve
failure, rather than asserting later on in the io thread.

Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-02-16 14:42:55 +01:00
Ian Barber
b5d3373905 Moving to std::string in options 2012-02-14 23:10:06 +00:00
Ian Barber
770f84331f Allowing value 0, and moving code to get_address functions based on feedback 2012-02-11 15:09:03 +00:00
Ian Barber
7b32c9cb51 Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets 2012-02-08 22:06:46 +00:00
Martin Sustrik
8e21d64c97 Copyright dates adjusted to reflect reality
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 18:06:11 +01:00
Martin Sustrik
ac7717b7b3 250bpm copyrights added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 16:20:30 +01:00
Martin Sustrik
f78d9b6bfc Session class separated into socket-type-specific sessions
This is a preliminary patch allowing for socket-type-specific
functionality in the I/O thread. For example, message format
can be checked asynchronously and misbehaved connections dropped
straight away.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-09-15 10:00:23 +02:00
Martin Sustrik
8b7ac4c2a9 Close file descriptors on exec (issue 218)
When exec is executed to start a different process image old
0MQ file descriptors could stay open, thus blocking TCP ports
and alike. This patch should solve the problem.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-09-02 15:34:12 +02:00
Martin Sustrik
b01a8e1751 IPC address related functionality refactored into ipc_address_t class
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-18 11:08:22 +02:00
Martin Sustrik
b3bac17607 tcp_engine renamed to stream engine
The engine was not used exclusively for TCP connections.
Rather it was used to handle any socket with SOCK_STREAM
semantics. The class was renamed to reflect its true function.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-16 12:44:34 +02:00
Martin Sustrik
f63db009a1 Different listener implementations simplified
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-28 16:32:08 +02:00
Martin Sustrik
46b053b8d6 Dead code removed from TCP and IPC transports
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-28 13:46:16 +02:00
Martin Sustrik
5ac63140b0 Implementations of TCP and IPC transports separated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-28 13:19:55 +02:00