From 9b6ac0a1ea92b1ec99acdd021087f6d8fdc75f14 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 22 Aug 2017 12:11:21 -0700 Subject: Add support for 64-bit ids in idhash. We intend to use this with transports where dynamic "port numbers" might be 32-bits. This would allow us to formulate a 64-bit number representing a conversation, and be able to find that conversation by the 64-bit value. Note that the hashed values are probably not perfectly optimal, as only the low order bits are particularly significant in the hash. We might want to consider XOR'ing in the upper bits to address that. --- src/core/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 79c1602b..765a6d0c 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -31,7 +31,7 @@ struct nni_socket { nni_cv s_cv; nni_cv s_close_cv; - uint32_t s_id; + uint64_t s_id; uint32_t s_flags; unsigned s_refcnt; // protected by global lock void * s_data; // Protocol private @@ -81,7 +81,7 @@ nni_free_opt(nni_sockopt *opt) uint32_t nni_sock_id(nni_sock *s) { - return (s->s_id); + return ((uint32_t) s->s_id); } // nni_sock_sendq and nni_sock_recvq are called by the protocol to obtain -- cgit v1.2.3-70-g09d2