@@ -109,7 +109,7 @@ public class HttpListener
109
109
/// </remarks>
110
110
public SslProtocols SslProtocols
111
111
#pragma warning restore S2292 // Trivial properties should be auto-implemented
112
- // nanoFramework doesn't support auto-properties
112
+ // nanoFramework doesn't support auto-properties
113
113
{
114
114
get { return m_sslProtocols ; }
115
115
set { m_sslProtocols = value ; }
@@ -194,7 +194,7 @@ private void InitListener(string prefix, int port)
194
194
/// <param name="clientStream">The stream to add.</param>
195
195
internal void AddClientStream ( OutputNetworkStreamWrapper clientStream )
196
196
{
197
- lock ( m_ClientStreams )
197
+ lock ( m_ClientStreams )
198
198
{
199
199
m_ClientStreams . Add ( clientStream ) ;
200
200
}
@@ -207,7 +207,7 @@ internal void AddClientStream(OutputNetworkStreamWrapper clientStream)
207
207
/// <param name="clientStream">The stream to remove.</param>
208
208
internal void RemoveClientStream ( OutputNetworkStreamWrapper clientStream )
209
209
{
210
- lock ( m_ClientStreams )
210
+ lock ( m_ClientStreams )
211
211
{
212
212
for ( int i = 0 ; i < m_ClientStreams . Count ; i ++ )
213
213
{
@@ -283,7 +283,7 @@ private void WaitingConnectionThreadFunc(OutputNetworkStreamWrapper outputStream
283
283
outputStream . Dispose ( ) ;
284
284
}
285
285
}
286
- catch ( Exception ex )
286
+ catch ( Exception ex )
287
287
{
288
288
Debug . WriteLine ( ex . Message ) ;
289
289
}
@@ -310,7 +310,7 @@ public void Abort()
310
310
{
311
311
// First we shut down the service.
312
312
Close ( ) ;
313
-
313
+
314
314
// Now we need to go through list of all client sockets and close all of them.
315
315
// This will cause exceptions on read/write operations on these sockets.
316
316
foreach ( OutputNetworkStreamWrapper netStream in m_ClientStreams )
@@ -418,7 +418,7 @@ private void AcceptThreadFunc()
418
418
// Throws exception if this fails
419
419
// pass the server certificate
420
420
// do not require client certificate
421
- ( ( SslStream ) netStream ) . AuthenticateAsServer ( m_httpsCert , false , m_sslProtocols ) ;
421
+ ( ( SslStream ) netStream ) . AuthenticateAsServer ( m_httpsCert , false , m_sslProtocols ) ;
422
422
423
423
netStream . ReadTimeout = 10000 ;
424
424
}
@@ -465,13 +465,13 @@ public void Start()
465
465
lock ( lockObj )
466
466
{
467
467
if ( m_Closed ) throw new ObjectDisposedException ( ) ;
468
-
468
+
469
469
// If service was already started, the call has no effect.
470
470
if ( m_ServiceRunning )
471
471
{
472
472
return ;
473
473
}
474
-
474
+
475
475
m_listener = new Socket ( AddressFamily . InterNetwork , SocketType . Stream , ProtocolType . Tcp ) ;
476
476
477
477
try
@@ -532,7 +532,7 @@ public void Close()
532
532
{
533
533
// empty on purpose to catch any exceptions thrown when calling the Stop above
534
534
}
535
-
535
+
536
536
m_Closed = true ;
537
537
}
538
538
}
@@ -549,19 +549,19 @@ public void Close()
549
549
/// </para>
550
550
/// </remarks>
551
551
public void Stop ( )
552
- {
552
+ {
553
553
// Need to lock access to object, because Stop can be called from a
554
554
// different thread.
555
555
lock ( lockObj )
556
556
{
557
557
if ( m_Closed ) throw new ObjectDisposedException ( ) ;
558
-
558
+
559
559
m_ServiceRunning = false ;
560
-
560
+
561
561
// We close the server socket that listen for incoming connection.
562
562
// Connections that already accepted are processed.
563
563
// Connections that has been in queue for server socket, but not accepted, are lost.
564
- if ( m_listener != null )
564
+ if ( m_listener != null )
565
565
{
566
566
m_listener . Close ( ) ;
567
567
m_listener = null ;
@@ -604,7 +604,7 @@ public HttpListenerContext GetContext()
604
604
lock ( lockObj )
605
605
{
606
606
if ( m_Closed ) throw new ObjectDisposedException ( ) ;
607
-
607
+
608
608
if ( ! m_ServiceRunning ) throw new InvalidOperationException ( ) ;
609
609
}
610
610
@@ -640,7 +640,7 @@ public HttpListenerContext GetContext()
640
640
/// <itemref>false</itemref>.</value>
641
641
public bool IsListening
642
642
{
643
- get { return m_ServiceRunning ; }
643
+ get { return m_ServiceRunning ; }
644
644
}
645
645
646
646
/// <summary>
@@ -666,7 +666,7 @@ public int MaximumResponseHeadersLength
666
666
#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
667
667
throw new ArgumentOutOfRangeException ( ) ;
668
668
#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
669
- // can't add description as that would increase the deployment image size
669
+ // can't add description as that would increase the deployment image size
670
670
}
671
671
672
672
m_maxResponseHeadersLen = value ;
@@ -679,7 +679,7 @@ public int MaximumResponseHeadersLength
679
679
/// </summary>
680
680
public X509Certificate HttpsCert
681
681
#pragma warning restore S2292 // Trivial properties should be auto-implemented
682
- // nanoFramework doesn't support auto-properties
682
+ // nanoFramework doesn't support auto-properties
683
683
{
684
684
get { return m_httpsCert ; }
685
685
set { m_httpsCert = value ; }
0 commit comments