From 27ec2e167872efcd3967e86e5ba9adfe840b675a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 20 Sep 2011 06:08:01 +0000 Subject: [PATCH] expose incoming_connection_alert to python --- bindings/python/src/alert.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 57d84dad1..b0c8c9e07 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -37,6 +37,11 @@ std::string dht_announce_alert_ip(dht_announce_alert const& pa) return pa.ip.to_string(ec); } +tuple incoming_connection_alert_ip(incoming_connection_alert const& ica) +{ + return endpoint_to_tuple(ica.ip); +} + void bind_alert() { using boost::noncopyable; @@ -439,4 +444,10 @@ void bind_alert() enum_("kind") .value("tracker_no_anonymous", anonymous_mode_alert::tracker_not_anonymous) ; + + class_, noncopyable>( + "incoming_connection_alert", no_init) + .def_readonly("socket_type", &incoming_connection_alert::socket_type) + .add_property("ip", &incoming_connection_alert_ip) + ; }