galdor/lisp-zmq — pull request #3 by sshirokov (2012-01-31 21:20:29+00:00)
Title: Add and export `poll-item-sock` and `socket-id`

`poll-item-sock` will return the socket component from a pollitem struct. This is useful in iteration of the pollitems set after a poll to fire callbacks computed and tied to sockets rather than relying on the order that items are added to the poll list.

Also added is `socket-id` which returns the pointer address of the socket as an integer. I use this to store callbacks tied to a socket in a standard hash-table since the `:test 'equalp` to `make-hash-table` fails to correctly compare foreign pointers correctly as `cffi:pointer-eq` but compares integers representing addresses correctly, which should remain stable and usable as a socket identity without having to use custom hash table implementations.