[nanomsg] Re: Asynchronous (raw) sockets in nanomsg

  • From: Paul Colomiets <paul@xxxxxxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Sun, 17 Nov 2013 22:27:47 +0200

On Sat, Nov 16, 2013 at 8:53 PM, Martin Sustrik <sustrik@xxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 16/11/13 17:46, Schmurfy wrote:
>> I definetely like the idea of having the existing constructs
>> supporting async use, I used both zeromq and crossroads in
>> different personal projects but in the idea I only used XREQ/XREP
>> since I always had multiple req/rep in parallel. As for the
>> request_id the user should have full control over it but why not
>> add a new function in the library to generate ids in sequence ?
>>
>> int nn_init_sequence(int *seq); int nn_next_id(const int *seq);
>
> Another option would be to use user-provided IDs. Specifically void
> pointers would be nice as it allows to associate the request with
> arbitrary user-defined object.
>
> nn_req_send (int s, void *id, void *buf, size_t len, int flags);
>

Looks great. Should there be a way to cancel request? So the object
that "id" points to can be freed prematurely.

--
Paul

Other related posts: