Added the WebSocket.CheckSendParameters method

This commit is contained in:
sta
2015-08-21 16:31:50 +09:00
parent 09a64d67be
commit ddb5819a0e
4 changed files with 14 additions and 15 deletions

View File

@@ -503,8 +503,7 @@ namespace WebSocketSharp.Server
public void BroadcastAsync (Stream stream, int length, Action completed)
{
var msg = _state.CheckIfAvailable (false, true, false) ??
stream.CheckIfCanRead () ??
(length < 1 ? "'length' is less than 1." : null);
WebSocket.CheckSendParameters (stream, length);
if (msg != null) {
_logger.Error (msg);

View File

@@ -511,8 +511,7 @@ namespace WebSocketSharp.Server
public void BroadcastAsync (Stream stream, int length, Action completed)
{
var msg = _state.CheckIfAvailable (false, true, false) ??
stream.CheckIfCanRead () ??
(length < 1 ? "'length' is less than 1." : null);
WebSocket.CheckSendParameters (stream, length);
if (msg != null) {
_logger.Error (msg);