[Vortex] How to access user_data in channel object?

Robert M. Münch robert.muench at robertmuench.de
Mon Nov 10 18:13:11 CET 2008


Am 10.11.2008, 12:49 Uhr, schrieb Francis Brosnan Blazquez  
<francis at aspl.es>:

> I think you mean accessing to close_user_data and received_user_data.

Hi, that's correct.

> In that case I would be required to add new API functions to access to
> those values since they are private...
>
> In any case, I would recommend to use vortex_channel_set_data
> (before/after) using vortex_channel_new to configure those pointers so
> you can get them by only having a reference to the channel by using
> vortex_channel_get_data.

That would be the workaround I would use as well. But I don't think it's  
elegant nor consistent.

I think as you suggested adding an API to access this user-data is the  
most clear way. Because storing something in their but never getting it  
back is a bit strange. Especially if the user-data is something  
dynamically allocated. And, doing a double-housekeeping, first on my own  
and vortex on its own splits responsibility or at least opens the threat  
for a sideeffect.

If the contract is clear: Vortex never touches your user-data on its own.  
Than I think an access method is necessary, so that I can free dynamically  
allocated ressources.

-- 
Robert M. Münch
Management and IT freelancer
http://www.robertmuench.de


More information about the Vortex mailing list