@@ -26,11 +26,9 @@ public class WebSocketsModule : WebModuleBase
2626 /// Initialize WebSocket module
2727 /// </summary>
2828 public WebSocketsModule ( )
29- : base ( )
3029 {
3130 this . AddHandler ( ModuleMap . AnyPath , HttpVerbs . Any , ( server , context ) =>
3231 {
33-
3432 // check if it is a WebSocket request (this only works with Win8 and Windows 2012)
3533 if ( context . Request . IsWebSocketRequest == false )
3634 return false ;
@@ -63,7 +61,7 @@ public WebSocketsModule()
6361 public void RegisterWebSocketsServer < T > ( )
6462 where T : WebSocketsServer , new ( )
6563 {
66- RegisterWebSocketsServer ( typeof ( T ) ) ;
64+ RegisterWebSocketsServer ( typeof ( T ) ) ;
6765 }
6866
6967 /// <summary>
@@ -77,13 +75,14 @@ public void RegisterWebSocketsServer(Type socketType)
7775 throw new ArgumentException ( "Argument 'socketType' cannot be null" , nameof ( socketType ) ) ;
7876
7977 var attribute =
80- socketType . GetCustomAttributes ( typeof ( WebSocketHandlerAttribute ) , true ) . FirstOrDefault ( ) as
78+ socketType . GetCustomAttributes ( typeof ( WebSocketHandlerAttribute ) , true ) . FirstOrDefault ( ) as
8179 WebSocketHandlerAttribute ;
8280
8381 if ( attribute == null )
84- throw new ArgumentException ( "Argument 'socketType' needs a WebSocketHandlerAttribute" , nameof ( socketType ) ) ;
82+ throw new ArgumentException ( "Argument 'socketType' needs a WebSocketHandlerAttribute" ,
83+ nameof ( socketType ) ) ;
8584
86- this . _serverMap [ attribute . Path ] = ( WebSocketsServer ) Activator . CreateInstance ( socketType ) ;
85+ this . _serverMap [ attribute . Path ] = ( WebSocketsServer ) Activator . CreateInstance ( socketType ) ;
8786 }
8887
8988 /// <summary>
@@ -124,7 +123,7 @@ public void RegisterWebSocketsServer<T>(string path, T server)
124123 /// Decorate methods within controllers with this attribute in order to make them callable from the Web API Module
125124 /// Method Must match the WebServerModule.
126125 /// </summary>
127- [ AttributeUsage ( AttributeTargets . Class , AllowMultiple = false ) ]
126+ [ AttributeUsage ( AttributeTargets . Class ) ]
128127 public sealed class WebSocketHandlerAttribute : Attribute
129128 {
130129 /// <summary>
@@ -146,7 +145,7 @@ public WebSocketHandlerAttribute(string path)
146145 /// <value>
147146 /// The paths.
148147 /// </value>
149- public string Path { get ; private set ; }
148+ public string Path { get ; }
150149 }
151150
152151 /// <summary>
@@ -193,7 +192,7 @@ protected WebSocketsServer(bool enableConnectionWatchdog, int maxMessageSize)
193192 {
194193 this . _enableDisconnectedSocketColletion = enableConnectionWatchdog ;
195194 this . _maximumMessageSize = maxMessageSize ;
196-
195+
197196 RunConnectionWatchdog ( ) ;
198197 }
199198
@@ -268,7 +267,7 @@ public void AcceptWebSocket(WebServer server, HttpListenerContext context)
268267 // define a receive buffer
269268 var receiveBuffer = new byte [ receiveBufferSize ] ;
270269 // define a dynamic buffer that holds multi-part receptions
271- var receivedMessage = new List < byte > ( receiveBuffer . Length * 2 ) ;
270+ var receivedMessage = new List < byte > ( receiveBuffer . Length * 2 ) ;
272271
273272 // poll the WebSockets connections for reception
274273 while ( webSocketContext . WebSocket . State == WebSocketState . Open )
0 commit comments