@@ -58,7 +58,7 @@ public partial class HttpServer : IDisposable
58
58
internal HttpWebSocketConnectionCollection _wsCollection = new HttpWebSocketConnectionCollection ( ) ;
59
59
internal List < string > ? listeningPrefixes ;
60
60
internal HttpServerHandlerRepository handler ;
61
-
61
+
62
62
internal AutoResetEvent waitNextEvent = new AutoResetEvent ( false ) ;
63
63
internal bool isWaitingNextEvent = false ;
64
64
internal HttpServerExecutionResult ? waitingExecutionResult ;
@@ -221,36 +221,6 @@ out Router router
221
221
/// </type>
222
222
public HttpWebSocketConnectionCollection WebSockets { get => _wsCollection ; }
223
223
224
- /// <summary>
225
- /// Event that is called when this <see cref="HttpServer"/> computes an request and it's response.
226
- /// </summary>
227
- /// <definition>
228
- /// public event ServerExecutionEventHandler? OnConnectionClose;
229
- /// </definition>
230
- /// <remarks>
231
- /// This event is now obsolete and will be removed in later Sisk versions. Use HttpServerHandlers instead.
232
- /// </remarks>
233
- /// <type>
234
- /// Property
235
- /// </type>
236
- [ Obsolete ( "This event is now obsolete and will be removed in later Sisk versions. Use HttpServerHandlers instead." ) ]
237
- public event ServerExecutionEventHandler ? OnConnectionClose ;
238
-
239
- /// <summary>
240
- /// Event that is called when this <see cref="HttpServer"/> receives an request.
241
- /// </summary>
242
- /// <definition>
243
- /// public event ReceiveRequestEventHandler? OnConnectionOpen;
244
- /// </definition>
245
- /// <remarks>
246
- /// This event is now obsolete and will be removed in later Sisk versions. Use HttpServerHandlers instead.
247
- /// </remarks>
248
- /// <type>
249
- /// Property
250
- /// </type>
251
- [ Obsolete ( "This event is now obsolete and will be removed in later Sisk versions. Use HttpServerHandlers instead." ) ]
252
- public event ReceiveRequestEventHandler ? OnConnectionOpen ;
253
-
254
224
/// <summary>
255
225
/// Get Sisk version label.
256
226
/// </summary>
@@ -435,8 +405,12 @@ public void Start()
435
405
/// </type>
436
406
public void Stop ( )
437
407
{
408
+ handler . Stopping ( this ) ;
438
409
_isListening = false ;
439
410
httpListener . Stop ( ) ;
411
+
412
+ UnbindRouters ( ) ;
413
+ handler . Stopped ( this ) ;
440
414
}
441
415
442
416
/// <summary>
@@ -454,12 +428,5 @@ public void Dispose()
454
428
httpListener . Close ( ) ;
455
429
ServerConfiguration . Dispose ( ) ;
456
430
}
457
-
458
- private enum StreamMethodCallback
459
- {
460
- Nothing ,
461
- Abort ,
462
- Close
463
- }
464
431
}
465
432
}
0 commit comments