Open-Transactions/opentxs — pull request #430 by OttoAllmendinger (2014-11-19 08:28:51+00:00)
Title: Notary: send empty response on error

(Continuation of #426)

Currently, sending an invalid message causes the Notary to hang indefinitely
because ZeroMQ waits for a Send() call.

According to the name of the return value of `processMessage`, the Notary should
"disconnect" a client that sends an invalid request. However, ZMQ_REP is not
designed to be used that way:

> A socket of type ZMQ_REP is used by a service to receive requests from and
> send replies to a client. This socket type allows only an alternating sequence
> of zmq_recv(request) and subsequent zmq_send(reply) calls.

http://api.zeromq.org/3-2:zmq-socket

There may be a some way to disconnect a client that sends an message, but for
now, I think it is okay to just send an empty response for invalid requests.

Other changes:

* Log all messages
* Allow OTSocket_ZMQ_4 to send empty responses.