zeromq / zproto

A protocol framework for ZeroMQ
MIT License
237 stars 100 forks source link

zproto_server_c: Implement optional client context refcounting #398

Closed michal42 closed 6 years ago

michal42 commented 6 years ago

Add new functions engine_client_get() and engine_client_put() to allow the application to delay the destruction of the client context. Note that if the engine is done with the client context but the application is not, only the structure itself is kept, but its members are freed (it is half-dead aka zombie). The purpose is to allow the application to match pending work with this zombie client, nothing more. In malamute, this will be used to properly deal with pending stream traffic after a client disconnect.

michal42 commented 6 years ago

The respective malamute fix is here https://github.com/michal42/malamute/commits/client-refcount, but I can't submit it before this PR is accepted.