Package org.ldk.structs
Class SocketAddress
- java.lang.Object
-
- org.ldk.structs.SocketAddress
-
- Direct Known Subclasses:
SocketAddress.Hostname,SocketAddress.OnionV2,SocketAddress.OnionV3,SocketAddress.TcpIpV4,SocketAddress.TcpIpV6
public class SocketAddress 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 classSocketAddress.HostnameA hostname/port on which the peer is listening.static classSocketAddress.OnionV2An old-style Tor onion address/port on which the peer is listening.static classSocketAddress.OnionV3A new-style Tor onion address/port on which the peer is listening.static classSocketAddress.TcpIpV4An IPv4 address and port on which the peer is listening.static classSocketAddress.TcpIpV6An IPv6 address and port on which the peer is listening.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SocketAddressclone()Creates a copy of the SocketAddressbooleaneq(SocketAddress b)Checks if two SocketAddresss contain equal inner contents.booleanequals(Object o)protected voidfinalize()static Result_SocketAddressSocketAddressParseErrorZfrom_str(String s)Read a SocketAddress object from a stringstatic SocketAddresshostname(Hostname hostname, short port)Utility method to constructs a new Hostname-variant SocketAddressstatic SocketAddressonion_v2(byte[] a)Utility method to constructs a new OnionV2-variant SocketAddressstatic SocketAddressonion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port)Utility method to constructs a new OnionV3-variant SocketAddressstatic Result_SocketAddressDecodeErrorZread(byte[] ser)Read a SocketAddress from a byte array, created by SocketAddress_writestatic SocketAddresstcp_ip_v4(byte[] addr, short port)Utility method to constructs a new TcpIpV4-variant SocketAddressstatic SocketAddresstcp_ip_v6(byte[] addr, short port)Utility method to constructs a new TcpIpV6-variant SocketAddressbyte[]write()Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public SocketAddress clone()
Creates a copy of the SocketAddress
-
tcp_ip_v4
public static SocketAddress tcp_ip_v4(byte[] addr, short port)
Utility method to constructs a new TcpIpV4-variant SocketAddress
-
tcp_ip_v6
public static SocketAddress tcp_ip_v6(byte[] addr, short port)
Utility method to constructs a new TcpIpV6-variant SocketAddress
-
onion_v2
public static SocketAddress onion_v2(byte[] a)
Utility method to constructs a new OnionV2-variant SocketAddress
-
onion_v3
public static SocketAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port)
Utility method to constructs a new OnionV3-variant SocketAddress
-
hostname
public static SocketAddress hostname(Hostname hostname, short port)
Utility method to constructs a new Hostname-variant SocketAddress
-
eq
public boolean eq(SocketAddress b)
Checks if two SocketAddresss contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields.
-
write
public byte[] write()
Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
-
read
public static Result_SocketAddressDecodeErrorZ read(byte[] ser)
Read a SocketAddress from a byte array, created by SocketAddress_write
-
from_str
public static Result_SocketAddressSocketAddressParseErrorZ from_str(String s)
Read a SocketAddress object from a string
-
-