[Vortex] connection IDs

Jens Alfke jens at mooseyard.com
Tue Apr 22 01:13:07 CEST 2008


On 21 Apr '08, at 9:01 AM, Robert M. Münch wrote:

> I just found out that the connection ID on the client and the  
> listener is
> different for the same connection.

Connection IDs are local; I think there's just a counter in Vortex  
that gets incremented every time it opens a connection. That value  
isn't sent over the socket, as it wouldn't mean anything to the other  
peer.

If you want both sides of the connection to have a shared value that  
they can both use to refer to it, you'll have to implement it  
yourself. Having the client generate a UUID and send it to the  
listener over a custom channel might be the easiest way.

But I really can't think of a reason why both sides of the connection  
would need a shared ID to refer to it by. The connection is already an  
implicit shared state of every message sent across it.

If your listener needs to handle multiple connections, it can just  
call vortex_connection_set_data to tag the VortexConnection with a  
pointer to your own private object, and then use  
vortex_connection_get_data later to retrieve that pointer. That way  
you can map between them bidirectionally.

—Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080421/fe446f8e/attachment.bin 


More information about the Vortex mailing list