diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-22 12:11:21 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-22 12:11:21 -0700 |
| commit | 9b6ac0a1ea92b1ec99acdd021087f6d8fdc75f14 (patch) | |
| tree | 7cac47944d1772997fd4d458b5bf6c311edd572c /src/core/endpt.c | |
| parent | 6b66debe7532bd7c3b0c88da7332315d90a84d43 (diff) | |
| download | nng-9b6ac0a1ea92b1ec99acdd021087f6d8fdc75f14.tar.gz nng-9b6ac0a1ea92b1ec99acdd021087f6d8fdc75f14.tar.bz2 nng-9b6ac0a1ea92b1ec99acdd021087f6d8fdc75f14.zip | |
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.
Diffstat (limited to 'src/core/endpt.c')
| -rw-r--r-- | src/core/endpt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c index f90bd068..5b56b784 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -18,7 +18,7 @@ struct nni_ep { nni_tran_ep ep_ops; // transport ops nni_tran * ep_tran; // transport pointer void * ep_data; // transport private - uint32_t ep_id; // endpoint id + uint64_t ep_id; // endpoint id nni_list_node ep_node; // per socket list nni_sock * ep_sock; char ep_addr[NNG_MAXADDRLEN]; @@ -78,7 +78,7 @@ nni_ep_sys_fini(void) uint32_t nni_ep_id(nni_ep *ep) { - return (ep->ep_id); + return ((uint32_t) ep->ep_id); } static void |
