[Modify] Polish it

This commit is contained in:
sta 2021-05-31 20:47:10 +09:00
parent f05c916ac3
commit 7d038db8a8

View File

@ -492,8 +492,13 @@ namespace WebSocketSharp.Net
)
{
lock (_contextRegistrySync) {
if (!_listening)
throw new HttpListenerException (995);
if (!_listening) {
var msg = _disposed
? "The listener is closed."
: "The listener is stopped.";
throw new HttpListenerException (995, msg);
}
var ares = new HttpListenerAsyncResult (callback, state);