dotcloud/zerorpc-node — pull request #23 by eelcocramer (2013-04-24 15:16:38+00:00)
Title: Enable the lazy pirate pattern by allowing to add a linger time when closing the client socket

WARNING: also incorporates the node 0.10.x fix from @wookieb

Current behavior:

Server A has not started.
Client B: makes a request.
Client B: request times out.
Client B: closes the connection.
Server A: is started.
Server A: received the request.

Requests only get cancelled when the client program has ended.

This pull request enables the client to cancel outstanding requests a adding the linger time for outstanding request to the close function. Making the behavior:

Server A has not started.
Client B: makes a request.
Client B: request times out.
Client B: closes the connection with linger time 0.
Server A; is started.
Server A: does NOT receive the request.

This will allow client to implement the lazy pirate pattern: http://zguide.zeromq.org/page:all#Client-Side-Reliability-Lazy-Pirate-Pattern