[Modify] Polish it
This commit is contained in:
parent
7f7498e8e8
commit
64a390c66a
@ -827,7 +827,8 @@ namespace WebSocketSharp.Server
|
||||
public void BroadcastAsync (Stream stream, int length, Action completed)
|
||||
{
|
||||
if (_state != ServerState.Start) {
|
||||
var msg = "The current state of the manager is not Start.";
|
||||
var msg = "The current state of the service is not Start.";
|
||||
|
||||
throw new InvalidOperationException (msg);
|
||||
}
|
||||
|
||||
@ -836,29 +837,30 @@ namespace WebSocketSharp.Server
|
||||
|
||||
if (!stream.CanRead) {
|
||||
var msg = "It cannot be read.";
|
||||
|
||||
throw new ArgumentException (msg, "stream");
|
||||
}
|
||||
|
||||
if (length < 1) {
|
||||
var msg = "Less than 1.";
|
||||
var msg = "It is less than 1.";
|
||||
|
||||
throw new ArgumentException (msg, "length");
|
||||
}
|
||||
|
||||
var bytes = stream.ReadBytes (length);
|
||||
|
||||
var len = bytes.Length;
|
||||
|
||||
if (len == 0) {
|
||||
var msg = "No data could be read from it.";
|
||||
|
||||
throw new ArgumentException (msg, "stream");
|
||||
}
|
||||
|
||||
if (len < length) {
|
||||
_log.Warn (
|
||||
String.Format (
|
||||
"Only {0} byte(s) of data could be read from the stream.",
|
||||
len
|
||||
)
|
||||
);
|
||||
var fmt = "Only {0} byte(s) of data could be read from the stream.";
|
||||
var msg = String.Format (fmt, len);
|
||||
|
||||
_log.Warn (msg);
|
||||
}
|
||||
|
||||
if (len <= WebSocket.FragmentLength)
|
||||
|
Loading…
Reference in New Issue
Block a user