{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1235","repository_url":"https://api.github.com/repos/aspnet/KestrelHttpServer","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1235/comments","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1235/events","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/1235","id":191813014,"number":1235,"title":"Error -4091 EADDRINUSE with Kestrel 1.1.0","user":{"login":"MichaCo","id":5837539,"avatar_url":"https://avatars.githubusercontent.com/u/5837539?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaCo","html_url":"https://github.com/MichaCo","followers_url":"https://api.github.com/users/MichaCo/followers","following_url":"https://api.github.com/users/MichaCo/following{/other_user}","gists_url":"https://api.github.com/users/MichaCo/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaCo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaCo/subscriptions","organizations_url":"https://api.github.com/users/MichaCo/orgs","repos_url":"https://api.github.com/users/MichaCo/repos","events_url":"https://api.github.com/users/MichaCo/events{/privacy}","received_events_url":"https://api.github.com/users/MichaCo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-26T16:05:24Z","updated_at":"2016-11-26T16:33:00Z","closed_at":"2016-11-26T16:33:00Z","body":"I'm having a strange issue after updating all packages to release 1.1.0 (from 1.0.0)\r\n\r\nI have a small test project bootstrapping a service. I find an open port by testing if it is in use or not right before creating the host like:\r\n\r\n```csharp\r\n    var endpoint = $\"http://{hostIP}:{port}\";\r\n    var host = new WebHostBuilder()\r\n        .UseKestrel()\r\n        .UseContentRoot(Directory.GetCurrentDirectory())\r\n        .UseUrls(endpoint)\r\n        .UseStartup<Startup>()\r\n        .Build();\r\n\r\n    host.Run();\r\n```\r\n\r\nWith version 1.1.0 I'm getting the following exception, consistently and knowing that the port is for sure NOT in use\r\n\r\n```\r\nUnhandled Exception: System.IO.IOException: Failed to bind to address http://192.168.178.23:5000: address already in use. \r\n---> System.AggregateException: One or more errors occurred. (Error -4091 EADDRINUSE address already in use) \r\n---> Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -4091 EADDRINUSE address already in use\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.ThrowError(Int32 statusCode)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.tcp_getsockname(UvTcpHandle handle, SockAddr& addr, Int32& namelen)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle.GetSockIPEndPoint()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.TcpListenerPrimary.CreateListenSocket()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener.<StartAsync>b__8_0(Object state)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.ListenerPrimary.<StartAsync>d__12.MoveNext()\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(ServerAddress address)\r\n   at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()\r\n   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage)\r\n   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)\r\n```\r\n\r\nRunning the exact same code with version 1.0.0 of all the Microsoft.* packages and using Microsoft.NETCore.App 1.0.0 instead of 1.1.0, it just works fine.\r\n\r\nTests are all done on Windows 10 locally.\r\n\r\nMore interestingly, if I use the hostname instead of an IP, it works again on 1.1.0!\r\n\r\nIs this somewhat intended that binding to an IP doesn't work but hostname or localhost or wildcards work?\r\n\r\nThanks,\r\nM"}}
{"actor":{"display_login":"MichaCo"}}