From b0034eee1cc7a04e105f1abadcc79377331e99ba Mon Sep 17 00:00:00 2001 From: Niek125 Date: Fri, 22 Jan 2021 15:08:34 +0100 Subject: [PATCH 1/2] first close then invoke --- .../src/cz/blocshop/socketsforcordova/SocketAdapterImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/src/cz/blocshop/socketsforcordova/SocketAdapterImpl.java b/src/android/src/cz/blocshop/socketsforcordova/SocketAdapterImpl.java index 6280aa1..a70a0bd 100644 --- a/src/android/src/cz/blocshop/socketsforcordova/SocketAdapterImpl.java +++ b/src/android/src/cz/blocshop/socketsforcordova/SocketAdapterImpl.java @@ -76,8 +76,8 @@ public class SocketAdapterImpl implements SocketAdapter { @Override public void close() throws IOException { - this.invokeCloseEventHandler(false); this.socket.close(); + this.invokeCloseEventHandler(false); } @Override From 3d3297e147a6938c4c4129d1612060d7678a7f1a Mon Sep 17 00:00:00 2001 From: Niek125 Date: Fri, 22 Jan 2021 16:50:55 +0100 Subject: [PATCH 2/2] first close stuff then say we closed it --- src/ios/SocketsForCordova/Classes/SocketAdapter.m | 2 +- src/wp8/src/SocketAdapter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/SocketsForCordova/Classes/SocketAdapter.m b/src/ios/SocketsForCordova/Classes/SocketAdapter.m index ac2c97b..734ff33 100644 --- a/src/ios/SocketsForCordova/Classes/SocketAdapter.m +++ b/src/ios/SocketsForCordova/Classes/SocketAdapter.m @@ -266,8 +266,8 @@ int writeTimeoutSeconds = 5.0; } - (void)close { - self.closeEventHandler(FALSE); [self closeStreams]; + self.closeEventHandler(FALSE); } - (void)closeStreams { diff --git a/src/wp8/src/SocketAdapter.cs b/src/wp8/src/SocketAdapter.cs index e61e1a7..fbbd27d 100644 --- a/src/wp8/src/SocketAdapter.cs +++ b/src/wp8/src/SocketAdapter.cs @@ -80,8 +80,8 @@ namespace Blocshop.ScoketsForCordova public void Close() { - this.CloseEventHandler(false); this.socket.Close(); + this.CloseEventHandler(false); } private void StartReadTask()