[Modify] Polish it
This commit is contained in:
parent
4e5c5f2f66
commit
b1fb4a171f
@ -674,11 +674,18 @@ namespace WebSocketSharp.Net
|
|||||||
public IAsyncResult BeginGetContext (AsyncCallback callback, Object state)
|
public IAsyncResult BeginGetContext (AsyncCallback callback, Object state)
|
||||||
{
|
{
|
||||||
CheckDisposed ();
|
CheckDisposed ();
|
||||||
if (_prefixes.Count == 0)
|
|
||||||
throw new InvalidOperationException ("The listener has no URI prefix on which listens.");
|
|
||||||
|
|
||||||
if (!_listening)
|
if (_prefixes.Count == 0) {
|
||||||
throw new InvalidOperationException ("The listener hasn't been started.");
|
var msg = "The listener has no URI prefix on which listens.";
|
||||||
|
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_listening) {
|
||||||
|
var msg = "The listener has not been started.";
|
||||||
|
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
|
||||||
return BeginGetContext (new HttpListenerAsyncResult (callback, state));
|
return BeginGetContext (new HttpListenerAsyncResult (callback, state));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user