Skip to content

Commit f60f16f

Browse files
committed
Fix for issue sta#84
1 parent 2a3a62e commit f60f16f

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

websocket-sharp/Ext.cs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -671,28 +671,24 @@ internal static void ReadBytesAsync (
671671
0,
672672
length,
673673
ar => {
674-
byte[] bytes = null;
675-
676674
try {
677-
var len = stream.EndRead (ar);
678-
bytes = len < 1
679-
? new byte[0]
680-
: len < length
681-
? stream.readBytes (buff, len, length - len)
682-
: buff;
683-
}
684-
catch (ObjectDisposedException) {
685-
// The Stream has been closed.
686-
return;
687-
}
688-
catch (Exception ex) {
689-
if (error != null)
690-
error (ex);
691-
692-
return;
693-
}
675+
byte[] bytes = null;
676+
try {
677+
var len = stream.EndRead (ar);
678+
bytes = len < 1
679+
? new byte[0]
680+
: len < length
681+
? stream.readBytes (buff, len, length - len)
682+
: buff;
683+
}
684+
catch (ObjectDisposedException) {
685+
// The Stream has been closed.
686+
return;
687+
}
688+
catch {
689+
throw;
690+
}
694691

695-
try {
696692
if (completed != null)
697693
completed (bytes);
698694
}

0 commit comments

Comments
 (0)