rolkey / indyproject

Automatically exported from code.google.com/p/indyproject
0 stars 0 forks source link

Make sure TIdConnectionIntercept.Connection is valid when possible #281

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, the TIdConnectionIntercept.Connection property is set to a non-nil 
value only when the TIdConnectionIntercept.Connect() method is called.  That 
method is currently only called in the TIdTCPClient.Connect() and 
TIdCustomTCPServer.ContextConnected() methods.

A change to consider would be to make the TIdTCPConnection.SetIntercept() 
method assign Self to the TIdConnectionIntercept.Connection property.  That 
would also require TIdCustomTCPServer.ContextConnected() to be changed to 
assign a newly created client Intercept to the TIdTCPConnection.Intercept 
property instead of the TIdIOHandler.Intercept property directly 
(TIdTCPConnection.SetIntercept() assigns the IOHandler.Intercept property 
internally).

TIdConnectionIntercept.Connect() would still be called, just to trigger the 
TIdConnectionIntercept.OnConnect event.

Original issue reported on code.google.com by gambit47 on 4 Mar 2014 at 6:35

GoogleCodeExporter commented 8 years ago

Original comment by gambit47 on 4 Mar 2014 at 6:36