@@ -24,7 +24,7 @@ public class HttpListenerServer : IHttpListener
24
24
public Func < IHttpRequest , Uri , Task > RequestHandler { get ; set ; }
25
25
26
26
private readonly Action < string > _endpointListener ;
27
-
27
+
28
28
public HttpListenerServer ( ILogger logger , Action < string > endpointListener )
29
29
{
30
30
_logger = logger ;
@@ -84,7 +84,7 @@ private void Listen()
84
84
private void ListenerCallback ( IAsyncResult asyncResult )
85
85
{
86
86
_listenForNextRequest . Set ( ) ;
87
-
87
+
88
88
var listener = asyncResult . AsyncState as HttpListener ;
89
89
HttpListenerContext context ;
90
90
@@ -161,6 +161,7 @@ private Task ProcessRequestAsync(HttpListenerContext context)
161
161
/// <returns>Task.</returns>
162
162
private async Task ProcessWebSocketRequest ( HttpListenerContext ctx )
163
163
{
164
+ #if ! __MonoCS__
164
165
try
165
166
{
166
167
var webSocketContext = await ctx . AcceptWebSocketAsync ( null ) . ConfigureAwait ( false ) ;
@@ -180,13 +181,14 @@ private async Task ProcessWebSocketRequest(HttpListenerContext ctx)
180
181
ctx . Response . StatusCode = 500 ;
181
182
ctx . Response . Close ( ) ;
182
183
}
184
+ #endif
183
185
}
184
186
185
187
private void HandleError ( Exception ex , HttpListenerContext context )
186
188
{
187
189
var operationName = context . Request . GetOperationName ( ) ;
188
190
var httpReq = GetRequest ( context , operationName ) ;
189
-
191
+
190
192
if ( ErrorHandler != null )
191
193
{
192
194
ErrorHandler ( ex , httpReq ) ;
@@ -280,4 +282,4 @@ protected virtual void Dispose(bool disposing)
280
282
}
281
283
}
282
284
}
283
- }
285
+ }
0 commit comments