Package org.ldk.structs
Class NetAddress
- java.lang.Object
-
- org.ldk.structs.NetAddress
-
- Direct Known Subclasses:
NetAddress.Hostname
,NetAddress.IPv4
,NetAddress.IPv6
,NetAddress.OnionV2
,NetAddress.OnionV3
public class NetAddress extends Object
An address which can be used to connect to a remote peer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NetAddress.Hostname
A hostname/port on which the peer is listening.static class
NetAddress.IPv4
An IPv4 address/port on which the peer is listening.static class
NetAddress.IPv6
An IPv6 address/port on which the peer is listening.static class
NetAddress.OnionV2
An old-style Tor onion address/port on which the peer is listening.static class
NetAddress.OnionV3
A new-style Tor onion address/port on which the peer is listening.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NetAddress
clone()
Creates a copy of the NetAddressboolean
eq(NetAddress b)
Checks if two NetAddresss contain equal inner contents.boolean
equals(Object o)
protected void
finalize()
static NetAddress
hostname(Hostname hostname, short port)
Utility method to constructs a new Hostname-variant NetAddressstatic NetAddress
ipv4(byte[] addr, short port)
Utility method to constructs a new IPv4-variant NetAddressstatic NetAddress
ipv6(byte[] addr, short port)
Utility method to constructs a new IPv6-variant NetAddressstatic NetAddress
onion_v2(byte[] a)
Utility method to constructs a new OnionV2-variant NetAddressstatic NetAddress
onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port)
Utility method to constructs a new OnionV3-variant NetAddressstatic Result_NetAddressDecodeErrorZ
read(byte[] ser)
Read a NetAddress from a byte array, created by NetAddress_writebyte[]
write()
Serialize the NetAddress object into a byte array which can be read by NetAddress_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public NetAddress clone()
Creates a copy of the NetAddress
-
ipv4
public static NetAddress ipv4(byte[] addr, short port)
Utility method to constructs a new IPv4-variant NetAddress
-
ipv6
public static NetAddress ipv6(byte[] addr, short port)
Utility method to constructs a new IPv6-variant NetAddress
-
onion_v2
public static NetAddress onion_v2(byte[] a)
Utility method to constructs a new OnionV2-variant NetAddress
-
onion_v3
public static NetAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port)
Utility method to constructs a new OnionV3-variant NetAddress
-
hostname
public static NetAddress hostname(Hostname hostname, short port)
Utility method to constructs a new Hostname-variant NetAddress
-
eq
public boolean eq(NetAddress b)
Checks if two NetAddresss contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields.
-
write
public byte[] write()
Serialize the NetAddress object into a byte array which can be read by NetAddress_read
-
read
public static Result_NetAddressDecodeErrorZ read(byte[] ser)
Read a NetAddress from a byte array, created by NetAddress_write
-
-