diff --git a/src/wp8/src/SocketPlugin.cs b/src/wp8/src/SocketPlugin.cs index 243eeb8..cced065 100644 --- a/src/wp8/src/SocketPlugin.cs +++ b/src/wp8/src/SocketPlugin.cs @@ -59,6 +59,12 @@ namespace Blocshop.ScoketsForCordova catch (SocketException ex) { this.DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, ex.Message)); + socketStorage.Remove(socketKey); + } + catch (AggregateException ex) + { + this.DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, ex.InnerException.Message)); + socketStorage.Remove(socketKey); } }