add incoming_connection_alert for logging all successful incoming connections

This commit is contained in:
Arvid Norberg
2011-09-17 01:44:05 +00:00
parent 3e91b45904
commit f5b5160169
8 changed files with 101 additions and 0 deletions

View File

@@ -7319,6 +7319,56 @@ having to call ``get_settings()``.
``error`` is an error code used for when an error occurs on the feed.
incoming_connection_alert
-------------------------
The incoming connection alert is posted every time we successfully accept
an incoming connection, through any mean. The most straigh-forward ways
of accepting incoming connections are through the TCP listen socket and
the UDP listen socket for uTP sockets. However, connections may also be
accepted ofer a Socks5 or i2p listen socket, or via a torrent specific
listen socket for SSL torrents.
::
struct incoming_connection_alert: alert
{
// ...
virtual std::string message() const;
int socket_type;
tcp::endpoint ip;
};
``socket_type`` tells you what kind of socket the connection was accepted
as:
+==========+=====================================+
| value | type |
+==========+=====================================+
| 0 | none (no socket instantiated) |
+----------+-------------------------------------+
| 1 | TCP |
+----------+-------------------------------------+
| 2 | Socks5 |
+----------+-------------------------------------+
| 3 | HTTP |
+----------+-------------------------------------+
| 4 | uTP |
+----------+-------------------------------------+
| 5 | i2p |
+----------+-------------------------------------+
| 6 | SSL/TCP |
+----------+-------------------------------------+
| 7 | SSL/Socks5 |
+----------+-------------------------------------+
| 8 | HTTPS (SSL/HTTP) |
+----------+-------------------------------------+
| 9 | SSL/uTP |
+----------+-------------------------------------+
``ip`` is the IP address and port the connection came from.
alert dispatcher
================