From 1bc76ac3b9b7e45c07c0b703bc18098d346f4f93 Mon Sep 17 00:00:00 2001 From: Geo Perez Date: Mon, 20 Feb 2017 15:38:54 -0600 Subject: [PATCH] Checking HttpConnection --- README.md | 14 +---- .../PeopleController.cs | 20 +++---- src/Unosquare.Labs.EmbedIO.Samples/Program.cs | 20 +++---- .../WebSocketsSample.cs | 10 ++++ .../html/index.html | 32 ++++------ .../html/scripts/app.controllers.js | 6 +- .../project.json | 2 +- .../System.Net/ChunkedInputStream.cs | 1 - .../System.Net/EndPointListener.cs | 5 +- .../System.Net/EndPointManager.cs | 25 ++++---- .../System.Net/HttpConnection.cs | 52 +++------------- .../System.Net/HttpListener.cs | 24 ++++---- .../System.Net/HttpListenerRequest.cs | 59 ++++++------------- .../System.Net/WebSocket.cs | 2 +- src/Unosquare.Labs.EmbedIO/project.json | 2 +- 15 files changed, 99 insertions(+), 175 deletions(-) diff --git a/README.md b/README.md index 0b13e608d..de2e81da0 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,6 @@ namespace Company.Project //server.Module().DefaultDocument = "index.html"; // Once we've registered our modules and configured them, we call the RunAsync() method. - // This is a non-blocking method (it return immediately) so in this case we avoid - // disposing of the object until a key is pressed. - //server.Run(); server.RunAsync(); // Fire up the browser to show the content if we are debugging! @@ -150,22 +147,15 @@ namespace Company.Project .WithLocalSession() .WithStaticFolderAt("c:/web"); - var cts = new CancellationTokenSource(); + var cts = new CancellationTokenSource(); var task = server.RunAsync(cts.Token); - // Fire up the browser to show the content if we are debugging! -#if DEBUG - var browser = new System.Diagnostics.Process() - { - StartInfo = new System.Diagnostics.ProcessStartInfo(url) {UseShellExecute = true} - }; - browser.Start(); -#endif // Wait for any key to be pressed before disposing of our web server. // In a service we'd manage the lifecycle of of our web server using // something like a BackgroundWorker or a ManualResetEvent. Console.ReadKey(true); cts.Cancel(); + try { task.Wait(); diff --git a/src/Unosquare.Labs.EmbedIO.Samples/PeopleController.cs b/src/Unosquare.Labs.EmbedIO.Samples/PeopleController.cs index 5eb817226..999b64675 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/PeopleController.cs +++ b/src/Unosquare.Labs.EmbedIO.Samples/PeopleController.cs @@ -3,11 +3,11 @@ using System; using System.Collections.Generic; using System.Linq; - using Unosquare.Labs.EmbedIO.Modules; + using Modules; using System.Threading.Tasks; using Tubular; using Swan; - using Unosquare.Tubular.ObjectModel; + using Tubular.ObjectModel; #if NET46 using System.Net; #else @@ -54,14 +54,14 @@ public bool GetPeople(WebServer server, HttpListenerContext context) return context.JsonResponse(_dbContext.People.SelectAll().First()); // otherwise, we need to parse the key and respond with the entity accordingly - int key = 0; - if (int.TryParse(lastSegment, out key)) - { - var single = _dbContext.People.Single(key); + int key; + if (!int.TryParse(lastSegment, out key)) + throw new KeyNotFoundException("Key Not Found: " + lastSegment); - if (single != null) - return context.JsonResponse(single); - } + var single = _dbContext.People.Single(key); + + if (single != null) + return context.JsonResponse(single); throw new KeyNotFoundException("Key Not Found: " + lastSegment); } @@ -86,7 +86,7 @@ public bool GetPeople(WebServer server, HttpListenerContext context) /// The server. /// The context. /// - /// Key Not Found: + lastSegment + /// Key Not Found: + lastSegment [WebApiHandler(HttpVerbs.Post, RelativePath + "people/*")] public async Task PostPeople(WebServer server, HttpListenerContext context) { diff --git a/src/Unosquare.Labs.EmbedIO.Samples/Program.cs b/src/Unosquare.Labs.EmbedIO.Samples/Program.cs index bfcb47d92..716aae387 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/Program.cs +++ b/src/Unosquare.Labs.EmbedIO.Samples/Program.cs @@ -1,21 +1,20 @@ namespace Unosquare.Labs.EmbedIO.Samples { + using Swan; using Modules; using System; internal class Program { - public static readonly bool IsMono = Type.GetType("Mono.Runtime") != null; - /// /// Defines the entry point of the application. /// /// The arguments. private static void Main(string[] args) { - Console.WriteLine("Running on Mono Runtime: {0}", IsMono); + $"Running on Mono Runtime: {Runtime.IsUsingMonoRuntime}".Info(); - var url = "http://localhost:9696/"; + var url = "http://localhost:8787/"; if (args.Length > 0) url = args[0]; @@ -56,10 +55,10 @@ private static void Main(string[] args) // If we want to enable sessions, we simply register the LocalSessionModule // Beware that this is an in-memory session storage mechanism so, avoid storing very large objects. // You can use the server.GetSession() method to get the SessionInfo object and manupulate it. - server.RegisterModule(new Modules.LocalSessionModule()); + server.RegisterModule(new LocalSessionModule()); // Set the CORS Rules - server.RegisterModule(new Modules.CorsModule( + server.RegisterModule(new CorsModule( // Origins, separated by comma without last slash "http://client.cors-api.appspot.com,http://unosquare.github.io,http://run.plnkr.co", // Allowed headers @@ -69,7 +68,7 @@ private static void Main(string[] args) // Register the static files server. See the html folder of this project. Also notice that // the files under the html folder have Copy To Output Folder = Copy if Newer - StaticFilesSample.Setup(server, !IsMono); + StaticFilesSample.Setup(server, useGzip: Runtime.IsUsingMonoRuntime == false); // Register the Web Api Module. See the Setup method to find out how to do it // It registers the WebApiModule and registers the controller(s) -- that's all. @@ -81,14 +80,11 @@ private static void Main(string[] args) server.RegisterModule(new FallbackModule((ws, ctx) => { - ctx.JsonResponse(new { Message = "Error " }); + ctx.JsonResponse(new {Message = "Error "}); return true; })); - // Once we've registered our modules and configured them, we call the Run() method. - // This is a non-blocking method (it return immediately) so in this case we avoid - // disposing of the object until a key is pressed. - //server.Run(); + // Once we've registered our modules and configured them, we call the RunAsync() method. server.RunAsync(); // Fire up the browser to show the content! diff --git a/src/Unosquare.Labs.EmbedIO.Samples/WebSocketsSample.cs b/src/Unosquare.Labs.EmbedIO.Samples/WebSocketsSample.cs index 474f2eade..67f903fc9 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/WebSocketsSample.cs +++ b/src/Unosquare.Labs.EmbedIO.Samples/WebSocketsSample.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Text; using Modules; + using Swan; #if NET46 using System.Threading; using System.Net.WebSockets; @@ -47,6 +48,12 @@ protected override void OnMessageReceived(WebSocketContext context, byte[] rxBuf { foreach (var ws in WebSockets) { +#if !NET46 + if (ws.UserEndPoint == null) + "Error ws.UserEndPoint".Warn(); + + $"WebSocket info: {ws.UserEndPoint}".Info(); +#endif if (ws != context) Send(ws, Encoding.UTF8.GetString(rxBuffer)); } @@ -92,6 +99,9 @@ protected override void OnFrameReceived(WebSocketContext context, byte[] rxBuffe protected override void OnClientDisconnected(WebSocketContext context) { Broadcast("Someone left the chat room."); +#if !NET46 + $"WebSocket closed: {context.UserEndPoint}".Info(); +#endif } } diff --git a/src/Unosquare.Labs.EmbedIO.Samples/html/index.html b/src/Unosquare.Labs.EmbedIO.Samples/html/index.html index 846e5e3b7..b1b763698 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/html/index.html +++ b/src/Unosquare.Labs.EmbedIO.Samples/html/index.html @@ -3,7 +3,6 @@ - EmbedIO - {{title.content}} - Unosquare Labs @@ -11,23 +10,6 @@ - - - - - - - - - - - - - - @@ -37,8 +19,20 @@
- © unosquare + © + unosquare
+ + + + + + + + + + + diff --git a/src/Unosquare.Labs.EmbedIO.Samples/html/scripts/app.controllers.js b/src/Unosquare.Labs.EmbedIO.Samples/html/scripts/app.controllers.js index a58bc9d8d..ec5f2f32f 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/html/scripts/app.controllers.js +++ b/src/Unosquare.Labs.EmbedIO.Samples/html/scripts/app.controllers.js @@ -4,7 +4,7 @@ .controller('TitleController', ['$scope', '$route', function ($scope, $route) { var me = this; me.content = "Home"; - $scope.$on('$routeChangeSuccess', function (currentRoute, previousRoute) { + $scope.$on('$routeChangeSuccess', function () { me.content = $route.current.title; }); }]) @@ -25,7 +25,7 @@ var me = this; me.nickName = "Bob"; me.message = ""; - me.wsUri = "ws://localhost:9696/chat"; + me.wsUri = "ws://" + document.location.hostname + ":" + document.location.port + "/chat"; me.messages = []; me.websocket = new WebSocket(me.wsUri); @@ -91,7 +91,7 @@ .controller('CmdController', ['$scope', function ($scope) { var me = this; me.command = ""; - me.wsUri = "ws://localhost:9696/terminal"; + me.wsUri = "ws://" + document.location.hostname + ":" + document.location.port + "/terminal"; me.commands = ""; me.scrollBottom = function () { diff --git a/src/Unosquare.Labs.EmbedIO.Samples/project.json b/src/Unosquare.Labs.EmbedIO.Samples/project.json index 5fd08b6b0..898d73fab 100644 --- a/src/Unosquare.Labs.EmbedIO.Samples/project.json +++ b/src/Unosquare.Labs.EmbedIO.Samples/project.json @@ -9,7 +9,7 @@ "Microsoft.Data.SQLite": "1.1.0", "Unosquare.Labs.EmbedIO": { "target": "project" }, "Tubular.ServerSide": "1.1.3", - "LiteLib": "0.9.10" + "LiteLib": "0.11.0" }, "frameworks": { diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/ChunkedInputStream.cs b/src/Unosquare.Labs.EmbedIO/System.Net/ChunkedInputStream.cs index 8a8af7c04..65607ebed 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/ChunkedInputStream.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/ChunkedInputStream.cs @@ -151,7 +151,6 @@ private void OnRead(IAsyncResult baseAres) } catch (Exception e) { - _context.Connection.SendError(e.Message, 400); ares.Complete(e); } } diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/EndPointListener.cs b/src/Unosquare.Labs.EmbedIO/System.Net/EndPointListener.cs index 883ec9461..e0e24db19 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/EndPointListener.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/EndPointListener.cs @@ -33,9 +33,9 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; -using System.Security.Cryptography.X509Certificates; using System.Threading; #if SSL +using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography; #endif @@ -112,7 +112,6 @@ private static void Accept(Socket socket, SocketAsyncEventArgs e, ref Socket acc } } - private static void ProcessAccept(SocketAsyncEventArgs args) { Socket accepted = null; @@ -120,7 +119,7 @@ private static void ProcessAccept(SocketAsyncEventArgs args) accepted = args.AcceptSocket; var epl = (EndPointListener) args.UserToken; - + Accept(epl._sock, args, ref accepted); if (accepted == null) return; diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/EndPointManager.cs b/src/Unosquare.Labs.EmbedIO/System.Net/EndPointManager.cs index 6997d2339..e0c88fd48 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/EndPointManager.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/EndPointManager.cs @@ -35,15 +35,14 @@ namespace Unosquare.Net { internal static class EndPointManager { - // Dictionary> - static readonly Hashtable _ipToEndpoints = new Hashtable(); + private static readonly Hashtable IPToEndpoints = new Hashtable(); public static void AddListener(HttpListener listener) { var added = new ArrayList(); try { - lock (_ipToEndpoints) + lock (IPToEndpoints) { foreach (var prefix in listener.Prefixes) { @@ -64,13 +63,13 @@ public static void AddListener(HttpListener listener) public static void AddPrefix(string prefix, HttpListener listener) { - lock (_ipToEndpoints) + lock (IPToEndpoints) { AddPrefixInternal(prefix, listener); } } - static void AddPrefixInternal(string p, HttpListener listener) + private static void AddPrefixInternal(string p, HttpListener listener) { var lp = new ListenerPrefix(p); if (lp.Path.IndexOf('%') != -1) @@ -107,14 +106,14 @@ private static EndPointListener GetEpListener(string host, int port, HttpListene } } Hashtable p = null; // Dictionary - if (_ipToEndpoints.ContainsKey(addr)) + if (IPToEndpoints.ContainsKey(addr)) { - p = (Hashtable)_ipToEndpoints[addr]; + p = (Hashtable)IPToEndpoints[addr]; } else { p = new Hashtable(); - _ipToEndpoints[addr] = p; + IPToEndpoints[addr] = p; } EndPointListener epl; @@ -133,14 +132,14 @@ private static EndPointListener GetEpListener(string host, int port, HttpListene public static void RemoveEndPoint(EndPointListener epl, IPEndPoint ep) { - lock (_ipToEndpoints) + lock (IPToEndpoints) { // Dictionary p - var p = (Hashtable)_ipToEndpoints[ep.Address]; + var p = (Hashtable)IPToEndpoints[ep.Address]; p.Remove(ep.Port); if (p.Count == 0) { - _ipToEndpoints.Remove(ep.Address); + IPToEndpoints.Remove(ep.Address); } epl.Close(); } @@ -148,7 +147,7 @@ public static void RemoveEndPoint(EndPointListener epl, IPEndPoint ep) public static void RemoveListener(HttpListener listener) { - lock (_ipToEndpoints) + lock (IPToEndpoints) { foreach (var prefix in listener.Prefixes) { @@ -159,7 +158,7 @@ public static void RemoveListener(HttpListener listener) public static void RemovePrefix(string prefix, HttpListener listener) { - lock (_ipToEndpoints) + lock (IPToEndpoints) { RemovePrefixInternal(prefix, listener); } diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/HttpConnection.cs b/src/Unosquare.Labs.EmbedIO/System.Net/HttpConnection.cs index eb488fa92..10a476da2 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/HttpConnection.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/HttpConnection.cs @@ -66,6 +66,7 @@ public HttpConnection(Socket sock, EndPointListener epl, bool secure, X509Certif _sock = sock; _epl = epl; IsSecure = secure; + if (secure == false) { Stream = new NetworkStream(sock, false); @@ -222,21 +223,14 @@ private void OnReadInternal(IAsyncResult ares) _ms.Write(_buffer, 0, nread); if (_ms.Length > 32768) { - SendError("Bad request", 400); Close(true); return; } } catch { - if (_ms != null && _ms.Length > 0) - SendError(); - - if (_sock != null) - { - CloseSocket(); - Unbind(); - } + CloseSocket(); + Unbind(); return; } @@ -254,19 +248,12 @@ private void OnReadInternal(IAsyncResult ares) if (!_context.HaveError) _context.Request.FinishInitialization(); - if (_context.HaveError) + if (_context.HaveError || !_epl.BindContext(_context)) { - SendError(); - Close(true); - return; - } - - if (!_epl.BindContext(_context)) - { - SendError("Invalid host", 400); Close(true); return; } + var listener = _context.Listener; if (_lastListener != listener) { @@ -401,6 +388,7 @@ private string ReadLine(byte[] buffer, int offset, int len, ref int used) } string result = null; + if (_lineState == LineState.Lf) { _lineState = LineState.None; @@ -410,33 +398,7 @@ private string ReadLine(byte[] buffer, int offset, int len, ref int used) return result; } - - public void SendError(string msg, int status) - { - try - { - var response = _context.Response; - response.StatusCode = status; - response.ContentType = "text/html"; - var description = HttpListenerResponseHelper.GetStatusDescription(status); - var str = msg != null - ? $"

{description} ({msg})

" - : $"

{description}

"; - - var error = _context.Response.ContentEncoding.GetBytes(str); - response.Close(error, false); - } - catch - { - // response was already closed - } - } - - public void SendError() - { - SendError(_context.ErrorMessage, _context.ErrorStatus); - } - + private void Unbind() { if (_contextBound) diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/HttpListener.cs b/src/Unosquare.Labs.EmbedIO/System.Net/HttpListener.cs index b06a87430..eb3da6f31 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/HttpListener.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/HttpListener.cs @@ -55,21 +55,21 @@ public sealed class HttpListener : IDisposable AuthenticationSchemes _authSchemes; AuthenticationSchemeSelector _authSelector; #endif - readonly HttpListenerPrefixCollection _prefixes; - string _realm; - bool _ignoreWriteExceptions; - bool _unsafeNtlmAuth; - bool _disposed; + private readonly HttpListenerPrefixCollection _prefixes; + private string _realm; + private bool _ignoreWriteExceptions; + private bool _unsafeNtlmAuth; + private bool _disposed; #if SSL IMonoTlsProvider tlsProvider; MSI.MonoTlsSettings tlsSettings; X509Certificate certificate; #endif - readonly Hashtable _registry; // Dictionary - readonly ArrayList _ctxQueue; // List ctx_queue; - readonly ArrayList _waitQueue; // List wait_queue; - readonly Hashtable _connections; + private readonly Hashtable _registry; // Dictionary + private readonly ArrayList _ctxQueue; // List ctx_queue; + private readonly ArrayList _waitQueue; // List wait_queue; + private readonly Hashtable _connections; //ServiceNameStore defaultServiceNames; //ExtendedProtectionPolicy _extendedProtectionPolicy; @@ -320,14 +320,14 @@ public void Close() _disposed = true; } - void Close(bool force) + private void Close(bool force) { CheckDisposed(); EndPointManager.RemoveListener(this); Cleanup(force); } - void Cleanup(bool closeExisting) + private void Cleanup(bool closeExisting) { lock (_registry) { @@ -517,7 +517,7 @@ internal void CheckDisposed() } // Must be called with a lock on ctx_queue - HttpListenerContext GetContextFromQueue() + private HttpListenerContext GetContextFromQueue() { if (_ctxQueue.Count == 0) return null; diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/HttpListenerRequest.cs b/src/Unosquare.Labs.EmbedIO/System.Net/HttpListenerRequest.cs index 5da99f8d2..d09683594 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/HttpListenerRequest.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/HttpListenerRequest.cs @@ -65,7 +65,7 @@ public class HttpVersion /// public sealed class HttpListenerRequest { - class Context : TransportContext + private class Context : TransportContext { public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) { @@ -73,22 +73,22 @@ public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) } } - Encoding _contentEncoding; - bool _clSet; - CookieCollection _cookies; - Stream _inputStream; - Uri _url; - readonly HttpListenerContext _context; - bool _isChunked; - bool _kaSet; - bool _keepAlive; + private Encoding _contentEncoding; + private bool _clSet; + private CookieCollection _cookies; + private Stream _inputStream; + private Uri _url; + private readonly HttpListenerContext _context; + private bool _isChunked; + private bool _kaSet; + private bool _keepAlive; #if SSL delegate X509Certificate2 GccDelegate(); GccDelegate _gccDelegate; #endif - static readonly byte[] _100Continue = Encoding.GetEncoding(0).GetBytes("HTTP/1.1 100 Continue\r\n\r\n"); + private static readonly byte[] _100Continue = Encoding.GetEncoding(0).GetBytes("HTTP/1.1 100 Continue\r\n\r\n"); internal HttpListenerRequest(HttpListenerContext context) { @@ -143,7 +143,7 @@ internal void SetRequestLine(string req) } } - void CreateQueryString(string query) + private void CreateQueryString(string query) { if (string.IsNullOrEmpty(query)) { @@ -172,7 +172,7 @@ void CreateQueryString(string query) } } - static bool MaybeUri(string s) + private static bool MaybeUri(string s) { var p = s.IndexOf(':'); if (p == -1) @@ -190,9 +190,7 @@ static bool MaybeUri(string s) // with "https": .16 vs .51 (second check) // with "foo": .22 vs .31 (never found) // with "mailto": .12 vs .51 (last check) - // - // - static bool IsPredefinedScheme(string scheme) + private static bool IsPredefinedScheme(string scheme) { if (scheme == null || scheme.Length < 3) return false; @@ -208,14 +206,11 @@ static bool IsPredefinedScheme(string scheme) c = scheme[1]; if (c == 'e') return (scheme == "news" || scheme == "net.pipe" || scheme == "net.tcp"); - if (scheme == "nntp") - return true; - return false; + + return scheme == "nntp"; } - if ((c == 'g' && scheme == "gopher") || (c == 'm' && scheme == "mailto")) - return true; - return false; + return (c == 'g' && scheme == "gopher") || (c == 'm' && scheme == "mailto"); } internal void FinishInitialization() @@ -266,7 +261,6 @@ internal void FinishInitialization() // 'identity' is not valid! if (tEncoding != null && !_isChunked) { - _context.Connection.SendError(null, 501); return; } } @@ -276,7 +270,6 @@ internal void FinishInitialization() if (string.Compare(HttpMethod, "POST", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(HttpMethod, "PUT", StringComparison.OrdinalIgnoreCase) == 0) { - _context.Connection.SendError(null, 411); return; } } @@ -665,17 +658,11 @@ public bool KeepAlive /// /// Gets the user agent. /// - /// - /// The user agent. - /// public string UserAgent => Headers["user-agent"]; /// /// Gets the user host address. /// - /// - /// The user host address. - /// public string UserHostAddress => LocalEndPoint.ToString(); /// @@ -689,33 +676,21 @@ public bool KeepAlive /// /// Gets the user languages. /// - /// - /// The user languages. - /// public string[] UserLanguages { get; private set; } /// /// Gets the name of the service. /// - /// - /// The name of the service. - /// public string ServiceName => null; /// /// Gets the transport context. /// - /// - /// The transport context. - /// public TransportContext TransportContext => new Context(); /// /// Gets a value indicating whether this request is a web socket request. /// - /// - /// true if this instance is web socket request; otherwise, false. - /// public bool IsWebSocketRequest => HttpMethod == "GET" && ProtocolVersion > HttpVersion.Version10 && Headers.Contains("Upgrade", "websocket") && Headers.Contains("Connection", "Upgrade"); #if SSL diff --git a/src/Unosquare.Labs.EmbedIO/System.Net/WebSocket.cs b/src/Unosquare.Labs.EmbedIO/System.Net/WebSocket.cs index 2a3a7eb9d..a8f9f6279 100644 --- a/src/Unosquare.Labs.EmbedIO/System.Net/WebSocket.cs +++ b/src/Unosquare.Labs.EmbedIO/System.Net/WebSocket.cs @@ -161,7 +161,7 @@ public class WebSocket : IDisposable private const string Guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; private bool _inContinuation; private volatile bool _inMessage; - private Action _message; + private readonly Action _message; private Queue _messageEventQueue; private string _origin; #if AUTHENTICATION diff --git a/src/Unosquare.Labs.EmbedIO/project.json b/src/Unosquare.Labs.EmbedIO/project.json index 129a8cec0..3366a999f 100644 --- a/src/Unosquare.Labs.EmbedIO/project.json +++ b/src/Unosquare.Labs.EmbedIO/project.json @@ -12,7 +12,7 @@ }, "dependencies": { - "Unosquare.Swan": "0.11.2" + "Unosquare.Swan": "0.12.0" }, "frameworks": {