[Modify] Polish it
This commit is contained in:
parent
fb1692d7ae
commit
e91b12161a
@ -752,16 +752,23 @@ namespace WebSocketSharp
|
|||||||
ar => {
|
ar => {
|
||||||
try {
|
try {
|
||||||
var nread = stream.EndRead (ar);
|
var nread = stream.EndRead (ar);
|
||||||
if (nread == 0 && retry < _retry) {
|
if (nread == 0) {
|
||||||
retry++;
|
if (retry < _retry) {
|
||||||
stream.BeginRead (buff, offset, length, callback, null);
|
retry++;
|
||||||
|
stream.BeginRead (buff, offset, length, callback, null);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (completed != null)
|
||||||
|
completed (buff.SubArray (0, offset));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nread == 0 || nread == length) {
|
if (nread == length) {
|
||||||
if (completed != null)
|
if (completed != null)
|
||||||
completed (buff.SubArray (0, offset + nread));
|
completed (buff);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user