Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mpisws.p2p.transport.multiaddress
Class MultiInetSocketAddress

    java.lang.Object
      org.mpisws.p2p.transport.multiaddress.MultiInetSocketAddress

All Implemented Interfaces:
  java.io.Serializable

    public class MultiInetSocketAddress

extends java.lang.Object
implements java.io.Serializable

Class which represets a source route to a remote IP address.

Version:
  $Id
Author:
  Jeff Hoye
See Also:
  Serialized Form

Field Summary
`protected java.net.InetSocketAddress[]` | `address`

Constructor Summary
`MultiInetSocketAddress(java.net.InetSocketAddress address)` Constructor
`MultiInetSocketAddress(java.net.InetSocketAddress[] addressList)`
`MultiInetSocketAddress(java.net.InetSocketAddress outer, java.net.InetSocketAddress inner)`

Method Summary
`boolean` | `addressEquals(MultiInetSocketAddress that)`
`static MultiInetSocketAddress` | `build(InputBuffer buf)` EpochInetSocketAddress: (IPV4): +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + numAddrs + IPVersion 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 0 ...
`boolean` | `equals(java.lang.Object o)` Checks equaltiy on source routes
`java.net.InetSocketAddress` | `getAddress(int index)`
`java.net.InetSocketAddress` | `getInnermostAddress()` This is for hairpinning support.
`int` | `getNumAddresses()`
`java.net.InetSocketAddress` | `getOutermostAddress()`
`short` | `getSerializedLength()`
`int` | `hashCode()` Returns the hashCode of this source route
`void` | `serialize(OutputBuffer buf)` EpochInetSocketAddress: (IPV4): +-+-+-+-+-+-+-+-+ + numAddrs + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address k + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port k + ...
`java.lang.String` | `toString()` Internal method for computing the toString of an array of InetSocketAddresses
`void` | `toStringShort(java.lang.StringBuffer result)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### address

    protected java.net.InetSocketAddress[] address

Constructor Detail

### MultiInetSocketAddress

    public MultiInetSocketAddress(java.net.InetSocketAddress address)

  Constructor

  Parameters:
    `address` - The remote address
    `epoch` - The remote epoch

### MultiInetSocketAddress

    public MultiInetSocketAddress(java.net.InetSocketAddress[] addressList)

### MultiInetSocketAddress

    public MultiInetSocketAddress(java.net.InetSocketAddress outer,
                                  java.net.InetSocketAddress inner)

Method Detail

### hashCode

    public int hashCode()

  Returns the hashCode of this source route

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    The hashCode

### equals

    public boolean equals(java.lang.Object o)

  Checks equaltiy on source routes

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `o` - The source route to compare to
  Returns:
    The equality

### addressEquals

    public boolean addressEquals(MultiInetSocketAddress that)

### toString

    public java.lang.String toString()

  Internal method for computing the toString of an array of InetSocketAddresses

  Overrides:
    `toString` in class `java.lang.Object`
  Parameters:
    `path` - The path
  Returns:
    THe string

### toStringShort

    public void toStringShort(java.lang.StringBuffer result)

### getInnermostAddress

    public java.net.InetSocketAddress getInnermostAddress()

  This is for hairpinning support. The Node is advertising many different InetSocketAddresses that it could be contacted on. In a typical NAT situation this will be 2: the NAT's external address, and the Node's non-routable address on the Lan. The algorithm sees if the external address matches its own external address. If it doesn't then the node is on a different lan, use the external. If the external address matches then both nodes are on the same Lan, and it uses the internal address because the NAT may not support hairpinning.

  Parameters:
    `local` - my sorted list of InetAddress
  Returns:
    the address I should use to contact the node

### getOutermostAddress

    public java.net.InetSocketAddress getOutermostAddress()

### getNumAddresses

    public int getNumAddresses()

### getAddress

    public java.net.InetSocketAddress getAddress(int index)

### build

    public static MultiInetSocketAddress build(InputBuffer buf)
                                        throws java.io.IOException

  EpochInetSocketAddress: (IPV4): +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + numAddrs + IPVersion 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 0 ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 0 + IPVersion 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 1 ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 1 + IPVersion k + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address k ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port k + ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  Parameters:
    `buf` -
  Returns:
  Throws:
    `java.io.IOException`

### serialize

    public void serialize(OutputBuffer buf)
                   throws java.io.IOException

  EpochInetSocketAddress: (IPV4): +-+-+-+-+-+-+-+-+ + numAddrs + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 0 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + internet address k + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + port k + ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + epoch (long) + + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  Parameters:
    `buf` -
  Throws:
    `java.io.IOException`

### getSerializedLength

    public short getSerializedLength()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.