[Modify] Polish it
This commit is contained in:
parent
5e28f47868
commit
1f196b7bb4
@ -741,12 +741,15 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public void Close (byte[] responseEntity, bool willBlock)
|
public void Close (byte[] responseEntity, bool willBlock)
|
||||||
{
|
{
|
||||||
checkDisposed ();
|
if (_disposed)
|
||||||
|
throw new ObjectDisposedException (GetType ().ToString ());
|
||||||
|
|
||||||
if (responseEntity == null)
|
if (responseEntity == null)
|
||||||
throw new ArgumentNullException ("responseEntity");
|
throw new ArgumentNullException ("responseEntity");
|
||||||
|
|
||||||
var len = responseEntity.Length;
|
var len = responseEntity.Length;
|
||||||
var output = OutputStream;
|
var output = OutputStream;
|
||||||
|
|
||||||
if (willBlock) {
|
if (willBlock) {
|
||||||
output.Write (responseEntity, 0, len);
|
output.Write (responseEntity, 0, len);
|
||||||
close (false);
|
close (false);
|
||||||
@ -762,7 +765,8 @@ namespace WebSocketSharp.Net
|
|||||||
output.EndWrite (ar);
|
output.EndWrite (ar);
|
||||||
close (false);
|
close (false);
|
||||||
},
|
},
|
||||||
null);
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user