05-05-2022, 05:33 PM
I'm setting up intercepts like this in my OnConnect events to track total bytes coming in and going out:
Do I need to call AContext.Connection.Intercept.Free in the OnDisconnect event or does that get cleaned up automatically when the connection ends?
Code:
AContext.Connection.Intercept := TIdConnectionIntercept.Create(AContext.Connection); // track total bytes in and out
AContext.Connection.Intercept.OnReceive := InterceptEvents.OnReceive;
AContext.Connection.Intercept.OnSend := InterceptEvents.OnSend;
Do I need to call AContext.Connection.Intercept.Free in the OnDisconnect event or does that get cleaned up automatically when the connection ends?