« Previous -
Version 3/5
(diff) -
Next » -
Current version
Alan McGovern, 10/24/2010 08:21 PM
BanningFiltering IPs¶
1 private void BanPeer (ClientEngine engine)
2 {
3 // Hook up a handler to the 'BanPeer' event. This is raised
4 // every time a connection is received or an outgoing connection
5 // is about to be created. If you wish to close/abort the connection
6 // just set "BanPeer" to true.
7 engine.ConnectionManager.BanPeer += delegate(object sender, AttemptConnectionEventArgs e) {
8 if (e.Peer.ConnectionUri.Host == "192.168.0.5")
9 e.BanPeer = true;
10 };
11 }