You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "binlijin (JIRA)" <ji...@apache.org> on 2012/09/06 10:05:08 UTC
[jira] [Updated] (HADOOP-8773) Improve Server#getRemoteAddress by
utilizing Server.Connection.hostAddress
[ https://issues.apache.org/jira/browse/HADOOP-8773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
binlijin updated HADOOP-8773:
-----------------------------
Description:
Connection :
public String getHostAddress() {
return hostAddress;
}
Inet4Address :
public String getHostAddress() {
return numericToTextFormat(getAddress());
}
public byte[] getAddress() {
byte[] addr = new byte[INADDRSZ];
addr[0] = (byte) ((address >>> 24) & 0xFF);
addr[1] = (byte) ((address >>> 16) & 0xFF);
addr[2] = (byte) ((address >>> 8) & 0xFF);
addr[3] = (byte) (address & 0xFF);
return addr;
}
static String numericToTextFormat(byte[] src)
{
return (src[0] & 0xff) + "." + (src[1] & 0xff) + "." + (src[2] & 0xff) + "." + (src[3] & 0xff);
}
> Improve Server#getRemoteAddress by utilizing Server.Connection.hostAddress
> ---------------------------------------------------------------------------
>
> Key: HADOOP-8773
> URL: https://issues.apache.org/jira/browse/HADOOP-8773
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: binlijin
> Priority: Minor
>
> Connection :
> public String getHostAddress() {
> return hostAddress;
> }
> Inet4Address :
> public String getHostAddress() {
> return numericToTextFormat(getAddress());
> }
> public byte[] getAddress() {
> byte[] addr = new byte[INADDRSZ];
> addr[0] = (byte) ((address >>> 24) & 0xFF);
> addr[1] = (byte) ((address >>> 16) & 0xFF);
> addr[2] = (byte) ((address >>> 8) & 0xFF);
> addr[3] = (byte) (address & 0xFF);
> return addr;
> }
> static String numericToTextFormat(byte[] src)
> {
> return (src[0] & 0xff) + "." + (src[1] & 0xff) + "." + (src[2] & 0xff) + "." + (src[3] & 0xff);
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira