Topic Path: Symbol Reference > Classes > TIdIdent Class > TIdIdent Methods > Query Method
TIdIdent.Query Method

Performs an Ident query using a port number pair.

procedure Query(
    APortOnServer: Word; 
    APortOnClient: Word
the port on the server in use for the client connection of interest.
the port on the client in use for the client connection of interest. 

Query is a procedure that allows TIdIdent to establish a connection to the Ident server, and perform an Ident query using the port number pair identified in APortOnServer and APortOnClient. 

Set the value in Host prior to calling the Query method. Port is given the default value as identified in RFC 1413, but can be changed prior to calling Query (if your Ident server listens on a different port number). 

Query calls Connect to open an ident session, and writes the comma-delimited port number pair that identifies the connection of interest. Query will wait for a response from the Ident server for the number of milliseconds specified in QueryTimeout. 

If a timeout occurs, the connection is closed by calling Disconnect and an EIdIdentQueryTimeOut is raised. 

When a response has been read from the Ident server, the return value is stored in Reply. The return value is also parsed to determine if it contains an Ident protocol response that indicates an error has occurred. 

If an error is detected, an exception derived from EIdIdentReply is raised that can include the following: 

EIdIdentInvalidPort EIdIdentNoUser EIdIdentHiddenUser EIdIdentUnknownError 

The parsed contents of a successful Ident response will be available in the ReplyCharset, ReplyOS, ReplyOther, and ReplyUserName properties.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.