8 IdBaseComponent
, IdSocketHandle
;
11 PIdConnectionIntercept
=^TIdConnectionIntercept
;
12 PIdServerIntercept
=^TIdServerIntercept
;
13 TIdConnectionIntercept
= object(TIdBaseComponent
)
15 FBinding
: PIdSocketHandle
;//TIdSocketHandle;
16 FOnConnect
: TOnEvent
;//TNotifyEvent;
17 FRecvHandling
: Boolean;
18 FSendHandling
: Boolean;
21 procedure Connect(ABinding
: PIdSocketHandle
{TIdSocketHandle}); virtual;
22 procedure DataReceived(var ABuffer
; const AByteCount
: integer); virtual;
23 procedure DataSent(var ABuffer
; const AByteCount
: integer); virtual;
24 procedure Disconnect
; virtual;
25 function Recv(var ABuf
; ALen
: Integer): Integer; virtual;
26 function Send(var ABuf
; ALen
: Integer): Integer; virtual;
28 property Binding
: PIdSocketHandle
{TIdSocketHandle} read FBinding
;
29 property IsClient
: Boolean read FIsClient
;
30 property RecvHandling
: boolean read FRecvHandling
;
31 property SendHandling
: boolean read FSendHandling
;
33 property OnConnect
: TOnEvent
{TNotifyEvent} read FOnConnect write FOnConnect
;
35 //PIdConnectionIntercept=^TIdConnectionIntercept;
37 TIdServerIntercept
= object(TIdBaseComponent
)
39 procedure _Init
; virtual; abstract;
40 function Accept(ABinding
: PIdSocketHandle
{TIdSocketHandle}): PIdConnectionIntercept
{TIdConnectionIntercept}; virtual;
43 //PdConnectionIntercept=^IdConnectionIntercept;
44 //PIdServerIntercept^=TIdServerIntercept;
46 function NewIdConnectionIntercept
:PIdConnectionIntercept
;
47 function NewIdServerIntercept
:PIdServerIntercept
;
51 function NewIdConnectionIntercept
:PIdConnectionIntercept
;
53 New( Result
, Create
);
56 function NewIdServerIntercept
:PIdServerIntercept
;
58 New( Result
, Create
);
61 procedure TIdConnectionIntercept
.Disconnect
;
66 procedure TIdConnectionIntercept
.DataReceived(var ABuffer
; const AByteCount
:
71 function TIdConnectionIntercept
.Recv(var ABuf
; ALen
: Integer): Integer;
76 function TIdConnectionIntercept
.Send(var ABuf
; ALen
: Integer): Integer;
81 procedure TIdConnectionIntercept
.DataSent(var ABuffer
; const AByteCount
:
86 procedure TIdConnectionIntercept
.Connect(ABinding
: PIdSocketHandle
{TIdSocketHandle});
89 if assigned(FOnConnect
) then