Indy 9
TIdServerIntercept
Hierarchy, Properties, Methods, See Also, Unit: IdIntercept
Specifies a socket handler for use with peer connections create by the listener thread in a TCP server.
TIdServerIntercept = class(TIdBaseComponent)
Unit
IdIntercept
Description
TIdServerIntercept is an abstract class that creates instances of TIdConnectionIntercept socket handlers for peer connections created by the listener thread in a TCP Server.

TIdConnectionIntercept descendants will be used by peer connection to act as an intermediary between the socket binding for the connection and low-level operations that communicate with the protocol stack.

TIdServerIntercept provides virtual methods to initialize the server socket handler, and to provide new TIdConnectionIntercept handlers for peer connections when the connection is accepted.

Call Init to perform initialization tasks prior to using the TIdServerIntercept instance to accepting connections. Call Accept to create the TIdConnectionIntercept handler used by the peer connection.

Note: Do not create instances of TIdServerIntercept. Use descendant classes, like TIdServerInterceptOpenSSL, or create custom descendants that implement the virtual methods of TIdServerIntercept.


TIdServerIntercept.Accept
TIdServerIntercept, See Also
Creates a socket handler for a peer connection.
function Accept(AConnection: TComponent): TIdConnectionIntercept; virtual; abstract;
Parameters
ABinding
Socket handle for the peer connection.

Return Values:

TIdConnectionIntercept
Socket handler for the peer connection.
Description
Accept is an abstract virtual TIdConnectionIntercept function that creates the socket handler to be used for a peer connection. Accept is used by TIdListenerThread descendants to create a socket handler for threads that must access a server using a socket handler.

ABinding is the socket handle used to communicate with the peer connection.

Descendant of TIdServerIntercept must implement the abstract Accept method to provide the TIdConnectionIntercept descendant that is appropriate for the TIdServerIntercept.


TIdServerIntercept.Init
TIdServerIntercept, See Also
Performs initialization tasks for the server socket handler.
procedure Init; virtual; abstract;
Description
Init is an abstract virtual procedure that allows the TIdServerIntercept instance to perform initialization tasks that are needed by the server socket handler. Descendant classes should implement Init to perform the actions appropriate to the server socket handler.

For example, TIdServerInterceptOpenSSL implements Init to load the SSL (Secure SOcket Layer) context needed to access the Root Certificate, the Certificate file, and the Key file needed to authorize SSL peer connections.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.