Refactored a few for Ext.cs

This commit is contained in:
sta 2015-07-11 16:29:09 +09:00
parent 96b684036f
commit 3c0fa929a1

View File

@ -776,11 +776,10 @@ namespace WebSocketSharp
return String.Format ("{0}; {1}", m, parameters.ToString ("; ")); return String.Format ("{0}; {1}", m, parameters.ToString ("; "));
} }
internal static System.Net.IPAddress ToIPAddress (this string hostNameOrAddress) internal static System.Net.IPAddress ToIPAddress (this string hostnameOrAddress)
{ {
try { try {
var addrs = System.Net.Dns.GetHostAddresses (hostNameOrAddress); return System.Net.Dns.GetHostAddresses (hostnameOrAddress)[0];
return addrs[0];
} }
catch { catch {
return null; return null;