]> git.bitcoin.ninja Git - ldk-java/commitdiff
Handle socket errors (the same as socket closure)
authorMatt Corallo <git@bluematt.me>
Mon, 15 Aug 2022 15:24:52 +0000 (15:24 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 15 Aug 2022 15:24:52 +0000 (15:24 +0000)
`gr0kchain` on Discord reported that not handling "error" causes
us to get unhandled exceptions, so we have to handle it.

node-net/net.mts

index 58da387d6c59177c363e2777f31091079558caf4..797bc7a7a47907920d9b00039d643cd82cd21133 100644 (file)
@@ -82,6 +82,9 @@ export class NodeLDKNet {
                socket.on("close", function() {
                        this_pm.socket_disconnected(descriptor);
                });
+               socket.on("error", function() {
+                       this_pm.socket_disconnected(descriptor);
+               });
 
                return descriptor;
        }