r10947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10946‎ | r10947 | r10948 >
Date:09:51, 8 September 2005
Author:vibber
Status:old
Tags:
Comment:
Option to bind to a particular local IP endpoint
Modified paths:
  • /trunk/mwblocker/MWBlocker/CheckPort.boo (modified) (history)

Diff [purge]

Index: trunk/mwblocker/MWBlocker/CheckPort.boo
@@ -43,7 +43,14 @@
4444
4545 def Connect(suspect as IPAddress):
4646 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()
4855 timeout = int.Parse(Config.Get("blocker", "timeout", "2000")) // milliseconds
4956 _client.SendTimeout = timeout
5057 _client.ReceiveTimeout = timeout

Status & tagging log