public class Ident extends Object
To use it:
Socket s = ss.accept();
Ident id = new Ident(s);
if(id.successful) goUseUser(id.userName);
else handleIdentError(id.errorCode,id.errorMessage)
Modifier and Type | Field and Description |
---|---|
static int |
connectionTimeout
Maximum amount of time we should wait before dropping the
connection to identd server.Setting it to 0 implies infinit
timeout.
|
static int |
ERR_NO_CONNECT
Identd on port 113 can't be contacted
|
static int |
ERR_PROTOCOL
Identd daemon responded with ERROR, in this case errorMessage
contains the string explanation, as send by the daemon.
|
static int |
ERR_PROTOCOL_INCORRECT
When parsing server response protocol error happened.
|
static int |
ERR_TIMEOUT
Connection timed out
|
int |
errorCode
Error code
|
String |
errorMessage
Error Message can be null.
|
String |
hostType
Host type as returned by daemon, can be null, if error happened
|
boolean |
successful
If this is true then userName and hostType contain valid values.
|
String |
userName
User name as returned by the identd daemon, or null, if it failed
|
public String errorMessage
public String hostType
public String userName
public boolean successful
public int errorCode
public static final int ERR_NO_CONNECT
public static final int ERR_TIMEOUT
public static final int ERR_PROTOCOL
public static final int ERR_PROTOCOL_INCORRECT
public static final int connectionTimeout
public Ident(Socket s)
If user name was successfully retrieved successful is set to true, and userName and hostType are set to whatever server returned. If however for some reason user name was not obtained, successful is set to false and errorCode contains the code explaining the reason of failure, and errorMessage contains human readable explanation.
Constructor may block, for a while.
s
- Socket whose ownership on remote end should be obtained.Copyright © 2024. All rights reserved.