File tree Expand file tree Collapse file tree 3 files changed +15
-27
lines changed
Default/WampSharp.WebSocket4Net/WAMP2/V2/Fluent
Extensions/WampSharp.WebSockets/WAMP2/V2/Fluent
WampSharp/WAMP2/V2/Transports Expand file tree Collapse file tree 3 files changed +15
-27
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,12 @@ public IControlledWampConnection<TMessage> Activate<TMessage>(IWampBinding<TMess
4242
4343 private IControlledWampConnection < TMessage > GetConnectionFactory < TMessage > ( IWampBinding < TMessage > binding )
4444 {
45-
46- if ( binding is IWampTextBinding < TMessage > textBinding )
47- {
48- return CreateTextConnection ( textBinding ) ;
49- }
50-
51-
52- if ( binding is IWampBinaryBinding < TMessage > binaryBinding )
45+ switch ( binding )
5346 {
54- return CreateBinaryConnection ( binaryBinding ) ;
47+ case IWampTextBinding < TMessage > textBinding :
48+ return CreateTextConnection ( textBinding ) ;
49+ case IWampBinaryBinding < TMessage > binaryBinding :
50+ return CreateBinaryConnection ( binaryBinding ) ;
5551 }
5652
5753 throw new Exception ( ) ;
Original file line number Diff line number Diff line change @@ -33,16 +33,12 @@ public IControlledWampConnection<TMessage> Activate<TMessage>(IWampBinding<TMess
3333
3434 private IControlledWampConnection < TMessage > GetConnectionFactory < TMessage > ( IWampBinding < TMessage > binding )
3535 {
36-
37- if ( binding is IWampTextBinding < TMessage > textBinding )
38- {
39- return CreateTextConnection ( textBinding ) ;
40- }
41-
42-
43- if ( binding is IWampBinaryBinding < TMessage > binaryBinding )
36+ switch ( binding )
4437 {
45- return CreateBinaryConnection ( binaryBinding ) ;
38+ case IWampTextBinding < TMessage > textBinding :
39+ return CreateTextConnection ( textBinding ) ;
40+ case IWampBinaryBinding < TMessage > binaryBinding :
41+ return CreateBinaryConnection ( binaryBinding ) ;
4642 }
4743
4844 throw new Exception ( ) ;
Original file line number Diff line number Diff line change @@ -106,16 +106,12 @@ protected abstract IWampConnection<TMessage> CreateTextConnection<TMessage>
106106
107107 public IWampConnectionListener < TMessage > GetListener < TMessage > ( IWampBinding < TMessage > binding )
108108 {
109-
110- if ( binding is IWampTextBinding < TMessage > textBinding )
111- {
112- return GetListener ( textBinding ) ;
113- }
114-
115-
116- if ( binding is IWampBinaryBinding < TMessage > binaryBinding )
109+ switch ( binding )
117110 {
118- return GetListener ( binaryBinding ) ;
111+ case IWampTextBinding < TMessage > textBinding :
112+ return GetListener ( textBinding ) ;
113+ case IWampBinaryBinding < TMessage > binaryBinding :
114+ return GetListener ( binaryBinding ) ;
119115 }
120116
121117 throw new ArgumentException ( "WebSockets can only deal with binary/text transports" , nameof ( binding ) ) ;
You can’t perform that action at this time.
0 commit comments