Skip to content

Commit

Permalink
Avoiding DnsEndPoint where practical
Browse files Browse the repository at this point in the history
  • Loading branch information
loudej committed Feb 26, 2013
1 parent 5247a19 commit dad68e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sakefile.shade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

var PROJECT='Firefly'
var VERSION='0.6'
var VERSION='0.6.1'
var FULL_VERSION='${VERSION}'
var AUTHORS='${PROJECT} contributors'

Expand Down
3 changes: 2 additions & 1 deletion src/main/Firefly/Http/ServerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -35,7 +36,7 @@ public ServerFactory(IFireflyService services)

public IDisposable Create(AppDelegate app, int port)
{
return Create(app, new IPEndPoint(0, port));
return Create(app, new IPEndPoint(IPAddress.Any, port));
}

public IDisposable Create(AppDelegate app, int port, string hostname)
Expand Down
13 changes: 9 additions & 4 deletions src/main/Firefly/Owin/OwinServerFactoryAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ public static IDisposable Create(AppFunc app, IDictionary<string, object> proper
var hostname = Host(address);
if (hostname == null || hostname == "*" || hostname == "+")
{
created.Add(factory.Create(app, port));
created.Add(factory.Create(app, new IPEndPoint(IPAddress.Any, port)));

Kickstart(new IPEndPoint(IPAddress.Loopback,port));
Kickstart(new IPEndPoint(IPAddress.Loopback, port));
}
else
{
created.Add(factory.Create(app, port, hostname));
foreach (var ipAddress in Dns.GetHostAddresses(hostname))
{
var endpoint = new IPEndPoint(ipAddress, port);

Kickstart(new DnsEndPoint(hostname, port));
created.Add(factory.Create(app, endpoint));

Kickstart(endpoint);
}
}
}
}
Expand Down

0 comments on commit dad68e8

Please sign in to comment.