/**
- * A pong message to be sent or received from a peer
+ * A [`pong`] message to be sent to or received from a peer.
+ *
+ * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
*/
public class Pong : CommonBase {
internal Pong(object _dummy, long ptr) : base(ptr) { }
/**
* The pong packet size.
+ *
* This field is not sent on the wire. byteslen zeros are sent.
*/
public short get_byteslen() {
/**
* The pong packet size.
+ *
* This field is not sent on the wire. byteslen zeros are sent.
*/
public void set_byteslen(short val) {
* Serialize the Pong object into a byte array which can be read by Pong_read
*/
public byte[] write() {
- byte[] ret = bindings.Pong_write(this.ptr);
+ long ret = bindings.Pong_write(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
}
/**
* Read a Pong from a byte array, created by Pong_write
*/
public static Result_PongDecodeErrorZ read(byte[] ser) {
- long ret = bindings.Pong_read(ser);
+ long ret = bindings.Pong_read(InternalUtils.encodeUint8Array(ser));
GC.KeepAlive(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);