Index: trunk/mwblocker/MWBlocker/CheckPort.boo |
— | — | @@ -43,7 +43,14 @@ |
44 | 44 | |
45 | 45 | def Connect(suspect as IPAddress): |
46 | 46 | Log("Connecting to port " + _port) |
47 | | - _client = TcpClient() |
| 47 | + iface = Config.Get("blocker", "interface") |
| 48 | + if iface: |
| 49 | + // Bind to a particular local IP address |
| 50 | + endpoint = IPEndPoint(IPAddress.Parse(iface), 0) |
| 51 | + _client = TcpClient(endpoint) |
| 52 | + else: |
| 53 | + // Bind to default interface |
| 54 | + _client = TcpClient() |
48 | 55 | timeout = int.Parse(Config.Get("blocker", "timeout", "2000")) // milliseconds |
49 | 56 | _client.SendTimeout = timeout |
50 | 57 | _client.ReceiveTimeout = timeout |