[Vortex] Race condition with auto-TLS

Francis Brosnan Blazquez francis at aspl.es
Fri Mar 7 17:42:43 CET 2008

Hi Jens,

> > I'm having trouble with race conditions, where apparently I'm trying  
> > to open a channel on an incoming connection before the TLS  
> > negotiations are completely finished. So now I'm trying to figure  
> > out how my code can be notified that the connection is ready to use.
> I"ve been looking through the code trying to figure out a way to do  
> this (or to extend Vortex to allow it) and I'm stumped. As far as I  
> can tell, the point where the incoming connection is TLS-ified and  
> ready to use is when the function __vortex_listener_second_step_accept  
> returns. But there's no notification to the client that this has  
> happened.
> Am I missing something? Or would I need to add a callback to the  
> client code at this point? (If so, I can't figure out where to put  
> it...)
> (I realize this is an atypical situation, because normally the process  
> accepting a connection is a server that waits passively for the first  
> client request. But my app is P2P, and in some cases a peer may want  
> to send messages to an incoming connection as soon as it opens.)

Looking at your description, I think it would save you a lot of problems
to let the channel creation to the peer that creates the connection and
tlsfixate it. 

Note I'm only talking about creating the channel running your p2p
profile. Then, the passive listener could use the created channel to
send data or open new channels when he (the listener) receives the start
channel request...


> Thanks,

Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.

More information about the Vortex mailing list