Fix for issue #84
This commit is contained in:
parent
36b860b75f
commit
2a3a62ec82
@ -671,14 +671,28 @@ namespace WebSocketSharp
|
||||
0,
|
||||
length,
|
||||
ar => {
|
||||
byte[] bytes = null;
|
||||
|
||||
try {
|
||||
var len = stream.EndRead (ar);
|
||||
var bytes = len < 1
|
||||
bytes = len < 1
|
||||
? new byte[0]
|
||||
: len < length
|
||||
? stream.readBytes (buff, len, length - len)
|
||||
: buff;
|
||||
}
|
||||
catch (ObjectDisposedException) {
|
||||
// The Stream has been closed.
|
||||
return;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
if (error != null)
|
||||
error (ex);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (completed != null)
|
||||
completed (bytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user