Jump to content
Registration disabled at the moment Read more... ×
patmandin

Shareable TIdSSLIOHandlerSocketOpenSSL?

Recommended Posts

Hello,

 

I am revisiting an email application I wrote a while ago, and that I would modify to evaluate TaurusTLS usage.

I came across code that may open both a TIdIMAP4 and a TIdSmtp at the same time, but that shares the same TIdSSLIOHandlerSocketOpenSSL component for dealing with SSL stuff.

 

Is it something that works (i.e. each component that uses it will create and get its own SSL work context), or is it a potential source of bugs (if each component that uses it overwrites what the other is doing) ?

Share this post


Link to post
Posted (edited)
53 minutes ago, patmandin said:

I came across code that may open both a TIdIMAP4 and a TIdSmtp at the same time, but that shares the same TIdSSLIOHandlerSocketOpenSSL component for dealing with SSL stuff.

 

Is it something that works (i.e. each component that uses it will create and get its own SSL work context)

No.  A single IOHandler object (of any type, SSL or otherwise) cannot be shared by multiple active connections at the same time.  Each connection needs its own unique (SSL)IOHandler object while it is connected to a peer.

53 minutes ago, patmandin said:

or is it a potential source of bugs (if each component that uses it overwrites what the other is doing) ?

Yes.  Each (SSL)IOHandler is associated with a single data transport (such as a socket), and a single set of buffers for incoming and outgoing data.

Edited by Remy Lebeau

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×