練習用です。いろんなものがごちゃまぜです。
| @@ -45,7 +45,7 @@ | ||
| 45 | 45 | } |
| 46 | 46 | String hostName = Dns.GetHostName(); |
| 47 | 47 | IPHostEntry iPHostEntry = Dns.GetHostEntry(hostName); |
| 48 | - IPAddress ipAddress = iPHostEntry.AddressList[0]; | |
| 48 | + IPAddress ipAddress = iPHostEntry.AddressList[4];//todo:IPv4のアドレスを選ぶように | |
| 49 | 49 | sock = new Socket( |
| 50 | 50 | AddressFamily.InterNetwork, |
| 51 | 51 | SocketType.Stream, |