| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsocks.server.Ident
public class Ident
Class Ident provides means to obtain user name of the owner of the socket on remote machine, providing remote machine runs identd daemon.
 To use it:
   
   Socket s = ss.accept();
   Ident id = new Ident(s);
   if(id.successful) goUseUser(id.userName);
   else handleIdentError(id.errorCode,id.errorMessage)
   
| Field Summary | |
|---|---|
| static int | connectionTimeoutMaximum amount of time we should wait before dropping the connection to identd server.Setting it to 0 implies infinit timeout. | 
| static int | ERR_NO_CONNECTIdentd on port 113 can't be contacted | 
| static int | ERR_PROTOCOLIdentd daemon responded with ERROR, in this case errorMessage contains the string explanation, as send by the daemon. | 
| static int | ERR_PROTOCOL_INCORRECTWhen parsing server response protocol error happened. | 
| static int | ERR_TIMEOUTConnection timed out | 
|  int | errorCodeError code | 
|  java.lang.String | errorMessageError Message can be null. | 
|  java.lang.String | hostTypeHost type as returned by daemon, can be null, if error happened | 
|  boolean | successfulIf this is true then userName and hostType contain valid values. | 
|  java.lang.String | userNameUser name as returned by the identd daemon, or null, if it failed | 
| Constructor Summary | |
|---|---|
| Ident(java.net.Socket s)Constructor tries to connect to Identd daemon on the host of the given socket, and retrieve user name of the owner of given socket connection on remote machine. | |
| Method Summary | 
|---|
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public java.lang.String errorMessage
public java.lang.String hostType
public java.lang.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
| Constructor Detail | 
|---|
public Ident(java.net.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.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||