1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
12 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class PeerHandleError extends CommonBase {
17 PeerHandleError(Object _dummy, long ptr) { super(ptr); }
18 @Override @SuppressWarnings("deprecation")
19 protected void finalize() throws Throwable {
21 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
25 * Used to indicate that we probably can't make any future connections to this peer, implying
26 * we should go ahead and force-close any channels we have with it.
28 public boolean get_no_connection_possible() {
29 boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
34 * Used to indicate that we probably can't make any future connections to this peer, implying
35 * we should go ahead and force-close any channels we have with it.
37 public void set_no_connection_possible(boolean val) {
38 bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
42 * Constructs a new PeerHandleError given each field
44 public static PeerHandleError of(boolean no_connection_possible_arg) {
45 long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
46 if (ret < 1024) { return null; }
47 PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
48 ret_hu_conv.ptrs_to.add(ret_hu_conv);
53 * Creates a copy of the PeerHandleError
55 public PeerHandleError clone() {
56 long ret = bindings.PeerHandleError_clone(this.ptr);
57 if (ret < 1024) { return null; }
58 PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
59 ret_hu_conv.ptrs_to.add(this);