Skip to content

Commit c2166c5

Browse files
committed
Bind to IpAddress.Any instead of arbitrary interface
1 parent 022c069 commit c2166c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Dache.CacheHost/Communication/CacheHostServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public CacheHostServer(IMemCache memCache, ITagRoutingTable tagRoutingTable, int
8181

8282
// Establish the endpoint for the socket
8383
var ipHostInfo = Dns.GetHostEntry(string.Empty);
84-
var ipAddress = ipHostInfo.AddressList.First(i => i.AddressFamily == AddressFamily.InterNetwork);
85-
_localEndPoint = new IPEndPoint(ipAddress, port);
84+
// Listen on all interfaces
85+
_localEndPoint = new IPEndPoint(IPAddress.Any, port);
8686

8787
// Define the server
8888
_server = SimplSocket.CreateServer(() => new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp),

0 commit comments

Comments
 (0)