1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class PeerHandleError extends CommonBase {
18 PeerHandleError(Object _dummy, long ptr) { super(ptr); }
19 @Override @SuppressWarnings("deprecation")
20 protected void finalize() throws Throwable {
22 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
26 * Used to indicate that we probably can't make any future connections to this peer, implying
27 * we should go ahead and force-close any channels we have with it.
29 public boolean get_no_connection_possible() {
30 boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
31 Reference.reachabilityFence(this);
36 * Used to indicate that we probably can't make any future connections to this peer, implying
37 * we should go ahead and force-close any channels we have with it.
39 public void set_no_connection_possible(boolean val) {
40 bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
41 Reference.reachabilityFence(this);
42 Reference.reachabilityFence(val);
46 * Constructs a new PeerHandleError given each field
48 public static PeerHandleError of(boolean no_connection_possible_arg) {
49 long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
50 Reference.reachabilityFence(no_connection_possible_arg);
51 if (ret >= 0 && ret <= 4096) { return null; }
52 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
53 ret_hu_conv.ptrs_to.add(ret_hu_conv);
58 long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
59 Reference.reachabilityFence(this);
64 * Creates a copy of the PeerHandleError
66 public PeerHandleError clone() {
67 long ret = bindings.PeerHandleError_clone(this.ptr);
68 Reference.reachabilityFence(this);
69 if (ret >= 0 && ret <= 4096) { return null; }
70 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
71 ret_hu_conv.ptrs_to.add(this);