.. include:: header.rst

`home`__

__ reference.html

.. contents:: Table of contents
  :depth: 2
  :backlinks: none


The `pop_alerts()`__ function on `session`__ is the main interface for retrieving
alerts (warnings, messages and errors from libtorrent). If no alerts have
been posted by libtorrent `pop_alerts()`__ will return an empty list.

By default, only errors are reported. `settings_pack::alert_mask`__ can be
used to specify which kinds of events should be reported. The `alert`__ mask is
a combination of the `alert_category_t`__ flags in the `alert`__ class.

Every `alert`__ belongs to one or more category. There is a cost associated with
posting alerts. Only alerts that belong to an enabled category are
posted. Setting the `alert`__ bitmask to 0 will disable all alerts (except those
that are non-discardable). Alerts that are responses to API calls such as
`save_resume_data()`__ and `post_session_stats()`__ are non-discardable and will be
posted even if their category is disabled.

There are other `alert`__ base classes that some alerts derive from, all the
alerts that are generated for a specific torrent are derived from
`torrent_alert`__, and tracker events derive from `tracker_alert`__.

Alerts returned by `pop_alerts()`__ are only valid until the next call to
`pop_alerts()`__. You may not copy an `alert`__ object to access it after the next
call to `pop_alerts()`__. Internal members of alerts also become invalid once
`pop_alerts()`__ is called again.

.. raw:: html

	<a name="dht_routing_bucket"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_routing_bucket&labels=documentation&body=Documentation+under+heading+%22class+dht_routing_bucket%22+could+be+improved">report issue</a>]</span>



dht_routing_bucket
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ reference-Session.html#pop_alerts()
__ reference-Session.html#session
__ reference-Session.html#pop_alerts()
__ reference-Settings.html#alert_mask
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert_category_t
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Torrent_Handle.html#save_resume_data()
__ reference-Session.html#post_session_stats()
__ reference-Alerts.html#alert
__ reference-Alerts.html#torrent_alert
__ reference-Alerts.html#tracker_alert
__ reference-Session.html#pop_alerts()
__ reference-Session.html#pop_alerts()
__ reference-Alerts.html#alert
__ reference-Session.html#pop_alerts()
__ reference-Session.html#pop_alerts()
__ include/libtorrent/alert_types.hpp

struct to hold information about a single DHT routing table bucket




.. parsed-literal::
	

	struct dht_routing_bucket
	{
	   int num_nodes;
	   int num_replacements;
	   int last_active;
	};

.. raw:: html

	<a name="num_nodes"></a>
	<a name="num_replacements"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D%22+could+be+improved">report issue</a>]</span>


num_nodes num_replacements
	the total number of nodes and replacement nodes
	in the routing table
	


.. raw:: html

	<a name="last_active"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Blast_active%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Blast_active%5D%22+could+be+improved">report issue</a>]</span>


last_active
	number of seconds since last activity
	


.. raw:: html

	<a name="torrent_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_alert%22+could+be+improved">report issue</a>]</span>



torrent_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is a base class for alerts that are associated with a
specific torrent. It contains a handle to the torrent.

Note that by the time the client receives a `torrent_alert`__, its
``handle`` member may be invalid.


__ reference-Alerts.html#torrent_alert


.. parsed-literal::
	

	struct torrent_alert : alert
	{
	   std::string **message** () const override;
	   char const* **torrent_name** () const;
	
	   torrent_handle handle;
	};

.. raw:: html

	<a name="message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved">report issue</a>]</span>



message()
.........

.. parsed-literal::
	
	std::string **message** () const override;
	

returns the message associated with this `alert`__


__ reference-Alerts.html#alert

.. raw:: html

	<a name="handle"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bhandle%5D%22+could+be+improved">report issue</a>]</span>


handle
	The `torrent_handle`__ pointing to the torrent this
	`alert`__ is associated with.
	

__ reference-Torrent_Handle.html#torrent_handle
__ reference-Alerts.html#alert

.. raw:: html

	<a name="peer_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_alert%22+could+be+improved">report issue</a>]</span>



peer_alert
----------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The peer `alert`__ is a base class for alerts that refer to a specific peer. It includes all
the information to identify the peer. i.e. ``ip`` and ``peer-id``.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_alert : torrent_alert
	{
	   std::string **message** () const override;
	
	   aux::noexcept_movable<tcp::endpoint> endpoint;
	   peer_id pid;
	};

.. raw:: html

	<a name="endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bendpoint%5D%22+could+be+improved">report issue</a>]</span>


endpoint
	The peer's IP address and port.
	


.. raw:: html

	<a name="pid"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bpid%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bpid%5D%22+could+be+improved">report issue</a>]</span>


pid
	the peer ID, if known.
	


.. raw:: html

	<a name="tracker_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_alert%22+could+be+improved">report issue</a>]</span>



tracker_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is a base class used for alerts that are associated with a
specific tracker. It derives from `torrent_alert`__ since a tracker
is also associated with a specific torrent.


__ reference-Alerts.html#torrent_alert


.. parsed-literal::
	

	struct tracker_alert : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **tracker_url** () const;
	
	   aux::noexcept_movable<tcp::endpoint> local_endpoint;
	};

.. raw:: html

	<a name="tracker_url()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Btracker_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Btracker_url%28%29%5D%22+could+be+improved">report issue</a>]</span>



tracker_url()
.............

.. parsed-literal::
	
	char const* **tracker_url** () const;
	

returns a 0-terminated string of the tracker's URL



.. raw:: html

	<a name="local_endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved">report issue</a>]</span>


local_endpoint
	endpoint of the listen interface being announced
	


.. raw:: html

	<a name="torrent_removed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_removed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_removed_alert%22+could+be+improved">report issue</a>]</span>



torrent_removed_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The ``torrent_removed_alert`` is posted whenever a torrent is removed. Since
the torrent handle in its base class will usually be invalid (since the torrent
is already removed) it has the info hash as a member, to identify it.
It's posted when the ``alert_category::status`` bit is set in the alert_mask.

Note that the ``handle`` remains valid for some time after
`torrent_removed_alert`__ is posted, as long as some internal libtorrent
task (such as an I/O task) refers to it. Additionally, other alerts like
`save_resume_data_alert`__ may be posted after `torrent_removed_alert`__.
To synchronize on whether the torrent has been removed or not, call
`torrent_handle::in_session()`__. This will return true before
`torrent_removed_alert`__ is posted, and false afterward.

Even though the ``handle`` member doesn't point to an existing torrent anymore,
it is still useful for comparing to other handles, which may also no
longer point to existing torrents, but to the same non-existing torrents.

The ``torrent_handle`` acts as a ``weak_ptr``, even though its object no
longer exists, it can still compare equal to another weak pointer which
points to the same non-existent object.


__ reference-Alerts.html#torrent_removed_alert
__ reference-Alerts.html#save_resume_data_alert
__ reference-Alerts.html#torrent_removed_alert
__ reference-Torrent_Handle.html#in_session()
__ reference-Alerts.html#torrent_removed_alert


.. parsed-literal::
	

	struct torrent_removed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   info_hash_t info_hashes;
	   client_data_t userdata;
	};

.. raw:: html

	<a name="userdata"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_removed_alert%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_removed_alert%3A%3A%5Buserdata%5D%22+could+be+improved">report issue</a>]</span>


userdata
	'`userdata`` as set in `add_torrent_params`__ at torrent creation.
	This can be used to associate this torrent with related data
	in the client application more efficiently than info_hashes.
	

__ reference-Add_Torrent.html#add_torrent_params

.. raw:: html

	<a name="read_piece_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+read_piece_alert&labels=documentation&body=Documentation+under+heading+%22class+read_piece_alert%22+could+be+improved">report issue</a>]</span>



read_piece_alert
----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when the asynchronous read operation initiated by
a call to `torrent_handle::read_piece()`__ is completed. If the read failed, the torrent
is paused and an error state is set and the buffer member of the `alert`__
is 0. If successful, ``buffer`` points to a buffer containing all the data
of the piece. ``piece`` is the piece index that was read. ``size`` is the
number of bytes that was read.

If the operation fails, ``error`` will indicate what went wrong.


__ reference-Alerts.html#alert
__ reference-Torrent_Handle.html#read_piece()
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct read_piece_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   error_code const error;
	   boost::shared_array<char> const buffer;
	   piece_index_t const piece;
	   int const size;
	};

.. raw:: html

	<a name="file_completed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_completed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_completed_alert%22+could+be+improved">report issue</a>]</span>



file_completed_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is posted whenever an individual file completes its download. i.e.
All pieces overlapping this file have passed their hash check.




.. parsed-literal::
	

	struct file_completed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   file_index_t const index;
	};

.. raw:: html

	<a name="index"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_completed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_completed_alert%3A%3A%5Bindex%5D%22+could+be+improved">report issue</a>]</span>


index
	refers to the index of the file that completed.
	


.. raw:: html

	<a name="file_renamed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_renamed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_renamed_alert%22+could+be+improved">report issue</a>]</span>



file_renamed_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is posted as a response to a `torrent_handle::rename_file()`__ call, if the rename
operation succeeds.


__ reference-Torrent_Handle.html#rename_file()


.. parsed-literal::
	

	struct file_renamed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **new_name** () const;
	   char const* **old_name** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   file_index_t const index;
	};

.. raw:: html

	<a name="new_name()"></a>
	<a name="old_name()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D%22+could+be+improved">report issue</a>]</span>



new_name() old_name()
.....................

.. parsed-literal::
	
	char const* **new_name** () const;
	char const* **old_name** () const;
	

returns the new and previous file name, respectively.



.. raw:: html

	<a name="index"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bindex%5D%22+could+be+improved">report issue</a>]</span>


index
	refers to the index of the file that was renamed,
	


.. raw:: html

	<a name="file_rename_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_rename_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_rename_failed_alert%22+could+be+improved">report issue</a>]</span>



file_rename_failed_alert
------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is posted as a response to a `torrent_handle::rename_file()`__ call, if the rename
operation failed.


__ reference-Torrent_Handle.html#rename_file()


.. parsed-literal::
	

	struct file_rename_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   file_index_t const index;
	   error_code const error;
	};

.. raw:: html

	<a name="index"></a>
	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_rename_failed_alert%3A%3A%5Bindex+error%5D&labels=documentation&body=Documentation+under+heading+%22file_rename_failed_alert%3A%3A%5Bindex+error%5D%22+could+be+improved">report issue</a>]</span>


index error
	refers to the index of the file that was supposed to be renamed,
	``error`` is the error code returned from the filesystem.
	


.. raw:: html

	<a name="performance_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+performance_alert&labels=documentation&body=Documentation+under+heading+%22class+performance_alert%22+could+be+improved">report issue</a>]</span>



performance_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a limit is reached that might have a negative impact on
upload or download rate performance.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct performance_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   enum performance_warning_t
	   {
	      outstanding_disk_buffer_limit_reached,
	      outstanding_request_limit_reached,
	      upload_limit_too_low,
	      download_limit_too_low,
	      send_buffer_watermark_too_low,
	      too_many_optimistic_unchoke_slots,
	      too_high_disk_queue_limit,
	      aio_limit_reached,
	      deprecated_bittyrant_with_no_uplimit,
	      too_few_outgoing_ports,
	      too_few_file_descriptors,
	      num_warnings,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::performance_warning;
	   performance_warning_t const warning_code;
	};

.. raw:: html

	<a name="performance_warning_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+performance_warning_t&labels=documentation&body=Documentation+under+heading+%22enum+performance_warning_t%22+could+be+improved">report issue</a>]</span>



enum performance_warning_t
..........................

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| name                                  | value | description                                                                                     |
+=======================================+=======+=================================================================================================+
| outstanding_disk_buffer_limit_reached | 0     | This warning means that the number of bytes queued to be written to disk                        |
|                                       |       | exceeds the max disk byte queue setting (``settings_pack::max_queued_disk_bytes``).             |
|                                       |       | This might restrict the download rate, by not queuing up enough write jobs                      |
|                                       |       | to the disk I/O thread. When this `alert`__ is posted, peer connections are                     |
|                                       |       | temporarily stopped from downloading, until the queued disk bytes have fallen                   |
|                                       |       | below the limit again. Unless your ``max_queued_disk_bytes`` setting is already                 |
|                                       |       | high, you might want to increase it to get better performance.                                  |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| outstanding_request_limit_reached     | 1     | This is posted when libtorrent would like to send more requests to a peer,                      |
|                                       |       | but it's limited by ``settings_pack::max_out_request_queue``. The queue length                  |
|                                       |       | libtorrent is trying to achieve is determined by the download rate and the                      |
|                                       |       | assumed round-trip-time (``settings_pack::request_queue_time``). The assumed                    |
|                                       |       | round-trip-time is not limited to just the network RTT, but also the remote disk                |
|                                       |       | access time and message handling time. It defaults to 3 seconds. The target number              |
|                                       |       | of outstanding requests is set to fill the bandwidth-delay product (assumed RTT                 |
|                                       |       | times download rate divided by number of bytes per request). When this `alert`__                |
|                                       |       | is posted, there is a risk that the number of outstanding requests is too low                   |
|                                       |       | and limits the download rate. You might want to increase the ``max_out_request_queue``          |
|                                       |       | setting.                                                                                        |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| upload_limit_too_low                  | 2     | This warning is posted when the amount of TCP/IP overhead is greater than the                   |
|                                       |       | upload rate limit. When this happens, the TCP/IP overhead is caused by a much                   |
|                                       |       | faster download rate, triggering TCP ACK packets. These packets eat into the                    |
|                                       |       | rate limit specified to libtorrent. When the overhead traffic is greater than                   |
|                                       |       | the rate limit, libtorrent will not be able to send any actual payload, such                    |
|                                       |       | as piece requests. This means the download rate will suffer, and new requests                   |
|                                       |       | can be sent again. There will be an equilibrium where the download rate, on                     |
|                                       |       | average, is about 20 times the upload rate limit. If you want to maximize the                   |
|                                       |       | download rate, increase the upload rate limit above 5% of your download capacity.               |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| download_limit_too_low                | 3     | This is the same warning as ``upload_limit_too_low`` but referring to the download              |
|                                       |       | limit instead of upload. This suggests that your download rate limit is much lower              |
|                                       |       | than your upload capacity. Your upload rate will suffer. To maximize upload rate,               |
|                                       |       | make sure your download rate limit is above 5% of your upload capacity.                         |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| send_buffer_watermark_too_low         | 4     | We're stalled on the disk. We want to write to the socket, and we can write                     |
|                                       |       | but our send buffer is empty, waiting to be refilled from the disk.                             |
|                                       |       | This either means the disk is slower than the network connection                                |
|                                       |       | or that our send buffer watermark is too small, because we can                                  |
|                                       |       | send it all before the disk gets back to us.                                                    |
|                                       |       | The number of bytes that we keep outstanding, requested from the disk, is calculated            |
|                                       |       | as follows:                                                                                     |
|                                       |       |                                                                                                 |
|                                       |       | .. code:: C++                                                                                   |
|                                       |       |                                                                                                 |
|                                       |       |    min(512, max(upload_rate * send_buffer_watermark_factor / 100, send_buffer_watermark))       |
|                                       |       |                                                                                                 |
|                                       |       | If you receive this `alert`__, you might want to either increase your ``send_buffer_watermark`` |
|                                       |       | or ``send_buffer_watermark_factor``.                                                            |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| too_many_optimistic_unchoke_slots     | 5     | If the half (or more) of all upload slots are set as optimistic unchoke slots, this             |
|                                       |       | warning is issued. You probably want more regular (rate based) unchoke slots.                   |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| too_high_disk_queue_limit             | 6     | If the disk write queue ever grows larger than half of the cache size, this warning             |
|                                       |       | is posted. The disk write queue eats into the total disk cache and leaves very little           |
|                                       |       | left for the actual cache. This causes the disk cache to oscillate in evicting large            |
|                                       |       | portions of the cache before allowing peers to download any more, onto the disk write           |
|                                       |       | queue. Either lower ``max_queued_disk_bytes`` or increase ``cache_size``.                       |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| aio_limit_reached                     | 7     |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| deprecated_bittyrant_with_no_uplimit  | 8     |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| too_few_outgoing_ports                | 9     | This is generated if outgoing peer connections are failing because of *address in use*          |
|                                       |       | errors, indicating that ``settings_pack::outgoing_ports`` is set and is too small of            |
|                                       |       | a range. Consider not using the ``outgoing_ports`` setting at all, or widen the range to        |
|                                       |       | include more ports.                                                                             |
|                                       |       |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| too_few_file_descriptors              | 10    |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+
| num_warnings                          | 11    |                                                                                                 |
+---------------------------------------+-------+-------------------------------------------------------------------------------------------------+


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="state_changed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_changed_alert&labels=documentation&body=Documentation+under+heading+%22class+state_changed_alert%22+could+be+improved">report issue</a>]</span>



state_changed_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

Generated whenever a torrent changes its state.




.. parsed-literal::
	

	struct state_changed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   torrent_status::state_t const state;
	   torrent_status::state_t const prev_state;
	};

.. raw:: html

	<a name="state"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bstate%5D%22+could+be+improved">report issue</a>]</span>


state
	the new state of the torrent.
	


.. raw:: html

	<a name="prev_state"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bprev_state%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bprev_state%5D%22+could+be+improved">report issue</a>]</span>


prev_state
	the previous state.
	


.. raw:: html

	<a name="tracker_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_error_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_error_alert%22+could+be+improved">report issue</a>]</span>



tracker_error_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated on tracker time outs, premature disconnects,
invalid response or a HTTP response other than "200 OK". From the `alert`__
you can get the handle to the torrent the tracker belongs to.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct tracker_error_alert final : tracker_alert
	{
	   std::string **message** () const override;
	   char const* **failure_reason** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker | alert_category::error;
	   int const times_in_row;
	   error_code const error;
	   operation_t op;
	   protocol_version version;
	};

.. raw:: html

	<a name="failure_reason()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D%22+could+be+improved">report issue</a>]</span>



failure_reason()
................

.. parsed-literal::
	
	char const* **failure_reason** () const;
	

if the tracker sent a "failure reason" string, it will be returned
here.



.. raw:: html

	<a name="times_in_row"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Btimes_in_row%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Btimes_in_row%5D%22+could+be+improved">report issue</a>]</span>


times_in_row
	This member says how many times in a row this tracker has failed.
	


.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error code indicating why the tracker announce failed. If it is
	is ``lt::errors::tracker_failure`` the `failure_reason()`__ might contain
	a more detailed description of why the tracker rejected the request.
	HTTP status codes indicating errors are also set in this field.
	

__ reference-Alerts.html#failure_reason()

.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that was announced
	


.. raw:: html

	<a name="tracker_warning_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_warning_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_warning_alert%22+could+be+improved">report issue</a>]</span>



tracker_warning_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is triggered if the tracker reply contains a warning field.
Usually this means that the tracker announce was successful, but the
tracker has a message to the client.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct tracker_warning_alert final : tracker_alert
	{
	   std::string **message** () const override;
	   char const* **warning_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker | alert_category::error;
	   protocol_version version;
	};

.. raw:: html

	<a name="warning_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



warning_message()
.................

.. parsed-literal::
	
	char const* **warning_message** () const;
	

the message associated with this warning



.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that was announced
	


.. raw:: html

	<a name="scrape_reply_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_reply_alert%22+could+be+improved">report issue</a>]</span>



scrape_reply_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a scrape request succeeds.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct scrape_reply_alert final : tracker_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker;
	   int const incomplete;
	   int const complete;
	   protocol_version version;
	};

.. raw:: html

	<a name="incomplete"></a>
	<a name="complete"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bincomplete+complete%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bincomplete+complete%5D%22+could+be+improved">report issue</a>]</span>


incomplete complete
	the data returned in the scrape response. These numbers
	may be -1 if the response was malformed.
	


.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that was scraped
	


.. raw:: html

	<a name="scrape_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_failed_alert%22+could+be+improved">report issue</a>]</span>



scrape_failed_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

If a scrape request fails, this `alert`__ is generated. This might be due
to the tracker timing out, refusing connection or returning an http response
code indicating an error.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct scrape_failed_alert final : tracker_alert
	{
	   std::string **message** () const override;
	   char const* **error_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker | alert_category::error;
	   error_code const error;
	   protocol_version version;
	};

.. raw:: html

	<a name="error_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



error_message()
...............

.. parsed-literal::
	
	char const* **error_message** () const;
	

if the error indicates there is an associated message, this returns
that message. Otherwise and empty string.



.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error itself. This may indicate that the tracker sent an error
	message (``error::tracker_failure``), in which case it can be
	retrieved by calling ``error_message()``.
	


.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that was scraped
	


.. raw:: html

	<a name="tracker_reply_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_reply_alert%22+could+be+improved">report issue</a>]</span>



tracker_reply_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is only for informational purpose. It is generated when a tracker announce
succeeds. It is generated regardless what kind of tracker was used, be it UDP, HTTP or
the DHT.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct tracker_reply_alert final : tracker_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker;
	   int const num_peers;
	   protocol_version version;
	};

.. raw:: html

	<a name="num_peers"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bnum_peers%5D%22+could+be+improved">report issue</a>]</span>


num_peers
	tells how many peers the tracker returned in this response. This is
	not expected to be greater than the ``num_want`` settings. These are not necessarily
	all new peers, some of them may already be connected.
	


.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that was announced
	


.. raw:: html

	<a name="dht_reply_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_reply_alert%22+could+be+improved">report issue</a>]</span>



dht_reply_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated each time the DHT receives peers from a node. ``num_peers``
is the number of peers we received in this packet. Typically these packets are
received from multiple DHT nodes, and so the alerts are typically generated
a few at a time.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_reply_alert final : tracker_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht | alert_category::tracker;
	   int const num_peers;
	};

.. raw:: html

	<a name="tracker_announce_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_announce_alert%22+could+be+improved">report issue</a>]</span>



tracker_announce_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated each time a tracker announce is sent (or attempted to be sent).
There are no extra data members in this `alert`__. The url can be found in the base class
however.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct tracker_announce_alert final : tracker_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::tracker;
	   event_t const event;
	   protocol_version version;
	};

.. raw:: html

	<a name="event"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bevent%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bevent%5D%22+could+be+improved">report issue</a>]</span>


event
	specifies what event was sent to the tracker. See `event_t`__.
	

__ reference-Core.html#event_t

.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	the bittorrent protocol version that is announced
	


.. raw:: html

	<a name="hash_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hash_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+hash_failed_alert%22+could+be+improved">report issue</a>]</span>



hash_failed_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a finished piece fails its hash check. You can get the handle
to the torrent which got the failed piece and the index of the piece itself from the `alert`__.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct hash_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="peer_ban_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_ban_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_ban_alert%22+could+be+improved">report issue</a>]</span>



peer_ban_alert
--------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer is banned because it has sent too many corrupt pieces
to us. ``ip`` is the endpoint to the peer that was banned.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_ban_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	};

.. raw:: html

	<a name="peer_unsnubbed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_unsnubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_unsnubbed_alert%22+could+be+improved">report issue</a>]</span>



peer_unsnubbed_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer is un-snubbed. Essentially when it was snubbed for stalling
sending data, and now it started sending data again.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_unsnubbed_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	};

.. raw:: html

	<a name="peer_snubbed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_snubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_snubbed_alert%22+could+be+improved">report issue</a>]</span>



peer_snubbed_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer is snubbed, when it stops sending data when we request
it.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_snubbed_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	};

.. raw:: html

	<a name="peer_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_error_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_error_alert%22+could+be+improved">report issue</a>]</span>



peer_error_alert
----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer sends invalid data over the peer-peer protocol. The peer
will be disconnected, but you get its ip address from the `alert`__, to identify it.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_error_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	   operation_t op;
	   error_code const error;
	};

.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	a 0-terminated string of the low-level operation that failed, or nullptr if
	there was no low level disk operation.
	


.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	tells you what error caused this `alert`__.
	

__ reference-Alerts.html#alert

.. raw:: html

	<a name="peer_connect_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_connect_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_connect_alert%22+could+be+improved">report issue</a>]</span>



peer_connect_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted every time an incoming peer connection both
successfully passes the protocol handshake and is associated with a
torrent, or an outgoing peer connection attempt succeeds. For arbitrary
incoming connections, see `incoming_connection_alert`__.


__ reference-Alerts.html#alert
__ reference-Alerts.html#incoming_connection_alert


.. parsed-literal::
	

	struct peer_connect_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   enum direction_t
	   {
	      in,
	      out,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::connect;
	   direction_t direction;
	   socket_type_t socket_type;
	};

.. raw:: html

	<a name="direction_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved">report issue</a>]</span>



enum direction_t
................

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+------+-------+-------------+
| name | value | description |
+======+=======+=============+
| in   | 0     |             |
+------+-------+-------------+
| out  | 1     |             |
+------+-------+-------------+



.. raw:: html

	<a name="direction"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_connect_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22peer_connect_alert%3A%3A%5Bdirection%5D%22+could+be+improved">report issue</a>]</span>


direction
	Tells you if the peer was incoming or outgoing
	


.. raw:: html

	<a name="peer_disconnected_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_disconnected_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_disconnected_alert%22+could+be+improved">report issue</a>]</span>



peer_disconnected_alert
-----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer is disconnected for any reason (other than the ones
covered by `peer_error_alert`__ ).


__ reference-Alerts.html#alert
__ reference-Alerts.html#peer_error_alert


.. parsed-literal::
	

	struct peer_disconnected_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::connect;
	   socket_type_t const socket_type;
	   operation_t const op;
	   error_code const error;
	   close_reason_t const reason;
	};

.. raw:: html

	<a name="socket_type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved">report issue</a>]</span>


socket_type
	the kind of socket this peer was connected over
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the operation or level where the error occurred. Specified as an
	value from the `operation_t`__ enum. Defined in operations.hpp.
	

__ reference-Alerts.html#operation_t

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	tells you what error caused peer to disconnect.
	


.. raw:: html

	<a name="reason"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Breason%5D%22+could+be+improved">report issue</a>]</span>


reason
	the reason the peer disconnected (if specified)
	


.. raw:: html

	<a name="invalid_request_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+invalid_request_alert&labels=documentation&body=Documentation+under+heading+%22class+invalid_request_alert%22+could+be+improved">report issue</a>]</span>



invalid_request_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is a debug `alert`__ that is generated by an incoming invalid piece request.
``ip`` is the address of the peer and the ``request`` is the actual incoming
request from the peer. See `peer_request`__ for more info.


__ reference-Alerts.html#alert
__ reference-Core.html#peer_request


.. parsed-literal::
	

	struct invalid_request_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	   peer_request const request;
	   bool const we_have;
	   bool const peer_interested;
	   bool const withheld;
	};

.. raw:: html

	<a name="request"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Brequest%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Brequest%5D%22+could+be+improved">report issue</a>]</span>


request
	the request we received from the peer
	


.. raw:: html

	<a name="we_have"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwe_have%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwe_have%5D%22+could+be+improved">report issue</a>]</span>


we_have
	true if we have this piece
	


.. raw:: html

	<a name="peer_interested"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bpeer_interested%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bpeer_interested%5D%22+could+be+improved">report issue</a>]</span>


peer_interested
	true if the peer indicated that it was interested to download before
	sending the request
	


.. raw:: html

	<a name="withheld"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwithheld%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwithheld%5D%22+could+be+improved">report issue</a>]</span>


withheld
	if this is true, the peer is not allowed to download this piece because
	of super-seeding rules.
	


.. raw:: html

	<a name="torrent_finished_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_finished_alert%22+could+be+improved">report issue</a>]</span>



torrent_finished_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a torrent switches from being a downloader to a seed.
It will only be generated once per torrent. It contains a `torrent_handle`__ to the
torrent in question.


__ reference-Alerts.html#alert
__ reference-Torrent_Handle.html#torrent_handle


.. parsed-literal::
	

	struct torrent_finished_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="piece_finished_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_finished_alert%22+could+be+improved">report issue</a>]</span>



piece_finished_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted every time a piece completes downloading
and passes the hash check. This `alert`__ derives from `torrent_alert`__
which contains the `torrent_handle`__ to the torrent the piece belongs to.
Note that being downloaded and passing the hash check may happen before
the piece is also fully flushed to disk. So `torrent_handle::have_piece()`__
may still return false


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#torrent_alert
__ reference-Torrent_Handle.html#torrent_handle
__ reference-Torrent_Handle.html#have_piece()


.. parsed-literal::
	

	struct piece_finished_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="piece_index"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_finished_alert%3A%3A%5Bpiece_index%5D&labels=documentation&body=Documentation+under+heading+%22piece_finished_alert%3A%3A%5Bpiece_index%5D%22+could+be+improved">report issue</a>]</span>


piece_index
	the index of the piece that finished
	


.. raw:: html

	<a name="request_dropped_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+request_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+request_dropped_alert%22+could+be+improved">report issue</a>]</span>



request_dropped_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a peer rejects or ignores a piece request.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct request_dropped_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="block_timeout_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_timeout_alert&labels=documentation&body=Documentation+under+heading+%22class+block_timeout_alert%22+could+be+improved">report issue</a>]</span>



block_timeout_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a block request times out.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct block_timeout_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="block_finished_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+block_finished_alert%22+could+be+improved">report issue</a>]</span>



block_finished_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a block request receives a response.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct block_finished_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="block_downloading_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_downloading_alert&labels=documentation&body=Documentation+under+heading+%22class+block_downloading_alert%22+could+be+improved">report issue</a>]</span>



block_downloading_alert
-----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a block request is sent to a peer.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct block_downloading_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="unwanted_block_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+unwanted_block_alert&labels=documentation&body=Documentation+under+heading+%22class+unwanted_block_alert%22+could+be+improved">report issue</a>]</span>



unwanted_block_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a block is received that was not requested or
whose request timed out.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct unwanted_block_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="storage_moved_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_alert%22+could+be+improved">report issue</a>]</span>



storage_moved_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The ``storage_moved_alert`` is generated when all the disk IO has
completed and the files have been moved, as an effect of a call to
``torrent_handle::move_storage``. This is useful to synchronize with the
actual disk. The ``storage_path()`` member return the new path of the
storage.




.. parsed-literal::
	

	struct storage_moved_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **old_path** () const;
	   char const* **storage_path** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	};

.. raw:: html

	<a name="storage_path()"></a>
	<a name="old_path()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D%22+could+be+improved">report issue</a>]</span>



storage_path() old_path()
.........................

.. parsed-literal::
	
	char const* **old_path** () const;
	char const* **storage_path** () const;
	

the path the torrent was moved to and from, respectively.



.. raw:: html

	<a name="storage_moved_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_failed_alert%22+could+be+improved">report issue</a>]</span>



storage_moved_failed_alert
--------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The ``storage_moved_failed_alert`` is generated when an attempt to move the storage,
via `torrent_handle::move_storage()`__, fails.


__ reference-Torrent_Handle.html#move_storage()


.. parsed-literal::
	

	struct storage_moved_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **file_path** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   error_code const error;
	   operation_t op;
	};

.. raw:: html

	<a name="file_path()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved">report issue</a>]</span>



file_path()
...........

.. parsed-literal::
	
	char const* **file_path** () const;
	

If the error happened for a specific file, this returns its path.



.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	this indicates what underlying operation caused the error
	


.. raw:: html

	<a name="torrent_deleted_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_deleted_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_deleted_alert%22+could+be+improved">report issue</a>]</span>



torrent_deleted_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a request to delete the files of a torrent complete.

This `alert`__ is posted in the ``alert_category::storage`` category, and that bit
needs to be set in the alert_mask.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct torrent_deleted_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   info_hash_t info_hashes;
	};

.. raw:: html

	<a name="info_hashes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_deleted_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_deleted_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved">report issue</a>]</span>


info_hashes
	The info-hash of the torrent that was just deleted. Most of
	the time the `torrent_handle`__ in the ``torrent_alert`` will be invalid by the time
	this `alert`__ arrives, since the torrent is being deleted. The ``info_hashes`` member
	is hence the main way of identifying which torrent just completed the delete.
	

__ reference-Torrent_Handle.html#torrent_handle
__ reference-Alerts.html#alert

.. raw:: html

	<a name="torrent_delete_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_delete_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_delete_failed_alert%22+could+be+improved">report issue</a>]</span>



torrent_delete_failed_alert
---------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a request to delete the files of a torrent fails.
Just removing a torrent from the `session`__ cannot fail


__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct torrent_delete_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage
	   | alert_category::error;
	   error_code const error;
	   info_hash_t info_hashes;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	tells you why it failed.
	


.. raw:: html

	<a name="info_hashes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved">report issue</a>]</span>


info_hashes
	the info hash of the torrent whose files failed to be deleted
	


.. raw:: html

	<a name="save_resume_data_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_alert%22+could+be+improved">report issue</a>]</span>



save_resume_data_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated as a response to a ``torrent_handle::save_resume_data`` request.
It is generated once the disk IO thread is done writing the state for this torrent.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct save_resume_data_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   add_torrent_params params;
	};

.. raw:: html

	<a name="params"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_alert%3A%3A%5Bparams%5D%22+could+be+improved">report issue</a>]</span>


params
	the ``params`` object is populated with the torrent file whose resume
	data was saved. It is suitable to be:
	
	* added to a `session`__ with `add_torrent()`__ or `async_add_torrent()`__
	* saved to disk with `write_resume_data()`__
	* turned into a magnet link with `make_magnet_uri()`__
	* saved as a .torrent file with `write_torrent_file()`__
	

__ reference-Session.html#session
__ reference-Session.html#add_torrent()
__ reference-Session.html#async_add_torrent()
__ reference-Resume_Data.html#write_resume_data()
__ reference-Core.html#make_magnet_uri()
__ reference-Resume_Data.html#write_torrent_file()

.. raw:: html

	<a name="save_resume_data_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_failed_alert%22+could+be+improved">report issue</a>]</span>



save_resume_data_failed_alert
-----------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated instead of ``save_resume_data_alert`` if there was an error
generating the resume data. ``error`` describes what went wrong.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct save_resume_data_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage
	   | alert_category::error;
	   error_code const error;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_failed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error code from the resume_data failure
	


.. raw:: html

	<a name="torrent_paused_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_paused_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_paused_alert%22+could+be+improved">report issue</a>]</span>



torrent_paused_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated as a response to a ``torrent_handle::pause`` request. It is
generated once all disk IO is complete and the files in the torrent have been closed.
This is useful for synchronizing with the disk.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct torrent_paused_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="torrent_resumed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_resumed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_resumed_alert%22+could+be+improved">report issue</a>]</span>



torrent_resumed_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated as a response to a `torrent_handle::resume()`__ request. It is
generated when a torrent goes from a paused state to an active state.


__ reference-Alerts.html#alert
__ reference-Torrent_Handle.html#resume()


.. parsed-literal::
	

	struct torrent_resumed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="torrent_checked_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_checked_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_checked_alert%22+could+be+improved">report issue</a>]</span>



torrent_checked_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when a torrent completes checking. i.e. when it transitions
out of the ``checking files`` state into a state where it is ready to start downloading


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct torrent_checked_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="url_seed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+url_seed_alert&labels=documentation&body=Documentation+under+heading+%22class+url_seed_alert%22+could+be+improved">report issue</a>]</span>



url_seed_alert
--------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a HTTP seed name lookup fails.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct url_seed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **server_url** () const;
	   char const* **error_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer | alert_category::error;
	   error_code const error;
	};

.. raw:: html

	<a name="server_url()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Bserver_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Bserver_url%28%29%5D%22+could+be+improved">report issue</a>]</span>



server_url()
............

.. parsed-literal::
	
	char const* **server_url** () const;
	

the URL the error is associated with



.. raw:: html

	<a name="error_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



error_message()
...............

.. parsed-literal::
	
	char const* **error_message** () const;
	

in case the web server sent an error message, this function returns
it.



.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error the web seed encountered. If this is not set, the server
	sent an error message, call ``error_message()``.
	


.. raw:: html

	<a name="file_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_error_alert&labels=documentation&body=Documentation+under+heading+%22class+file_error_alert%22+could+be+improved">report issue</a>]</span>



file_error_alert
----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

If the storage fails to read or write files that it needs access to, this `alert`__ is
generated and the torrent is paused.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct file_error_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **filename** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status
	   | alert_category::storage;
	   error_code const error;
	   operation_t op;
	};

.. raw:: html

	<a name="filename()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved">report issue</a>]</span>



filename()
..........

.. parsed-literal::
	
	char const* **filename** () const;
	

the file that experienced the error



.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error code describing the error.
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	indicates which underlying operation caused the error
	


.. raw:: html

	<a name="metadata_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_failed_alert%22+could+be+improved">report issue</a>]</span>



metadata_failed_alert
---------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when the metadata has been completely received and the info-hash
failed to match it. i.e. the metadata that was received was corrupt. libtorrent will
automatically retry to fetch it in this case. This is only relevant when running a
torrent-less download, with the metadata extension provided by libtorrent.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct metadata_failed_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   error_code const error;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:metadata_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22metadata_failed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	indicates what failed when parsing the metadata. This error is
	what's returned from lazy_bdecode().
	


.. raw:: html

	<a name="metadata_received_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_received_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_received_alert%22+could+be+improved">report issue</a>]</span>



metadata_received_alert
-----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when the metadata has been completely received and the torrent
can start downloading. It is not generated on torrents that are started with metadata, but
only those that needs to download it from peers (when utilizing the libtorrent extension).

There are no additional data members in this `alert`__.

Typically, when receiving this `alert`__, you would want to save the torrent file in order
to load it back up again when the `session`__ is restarted. Here's an example snippet of
code to do that:

.. code:: c++

	torrent_handle h = alert->handle();
	std::shared_ptr<torrent_info const> ti = h.torrent_file();
	create_torrent ct(*ti);
	entry te = ct.generate();
	std::vector<char> buffer;
	bencode(std::back_inserter(buffer), te);
	FILE* f = fopen((to_hex(ti->info_hashes().get_best().to_string()) + ".torrent").c_str(), "wb+");
	if (f) {
		fwrite(&buffer[0], 1, buffer.size(), f);
		fclose(f);
	}



__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct metadata_received_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="udp_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+udp_error_alert&labels=documentation&body=Documentation+under+heading+%22class+udp_error_alert%22+could+be+improved">report issue</a>]</span>



udp_error_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when there is an error on a UDP socket. The
UDP sockets are used for all uTP, DHT and UDP tracker traffic. They are
global to the `session`__.


__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct udp_error_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   aux::noexcept_movable<udp::endpoint> endpoint;
	   operation_t operation;
	   error_code const error;
	};

.. raw:: html

	<a name="endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Bendpoint%5D%22+could+be+improved">report issue</a>]</span>


endpoint
	the source address associated with the error (if any)
	


.. raw:: html

	<a name="operation"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Boperation%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Boperation%5D%22+could+be+improved">report issue</a>]</span>


operation
	the operation that failed
	


.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error code describing the error
	


.. raw:: html

	<a name="external_ip_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+external_ip_alert&labels=documentation&body=Documentation+under+heading+%22class+external_ip_alert%22+could+be+improved">report issue</a>]</span>



external_ip_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

Whenever libtorrent learns about the machines external IP, this `alert`__ is
generated. The external IP address can be acquired from the tracker (if it
supports that) or from peers that supports the extension protocol.
The address can be accessed through the ``external_address`` member.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct external_ip_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   aux::noexcept_movable<address> external_address;
	};

.. raw:: html

	<a name="external_address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:external_ip_alert%3A%3A%5Bexternal_address%5D&labels=documentation&body=Documentation+under+heading+%22external_ip_alert%3A%3A%5Bexternal_address%5D%22+could+be+improved">report issue</a>]</span>


external_address
	the IP address that is believed to be our external IP
	


.. raw:: html

	<a name="listen_failed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_failed_alert%22+could+be+improved">report issue</a>]</span>



listen_failed_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when none of the ports, given in the port range, to
`session`__ can be opened for listening. The ``listen_interface`` member is the
interface that failed, ``error`` is the error code describing the failure.

In the case an endpoint was created before generating the `alert`__, it is
represented by ``address`` and ``port``. The combinations of socket type
and operation in which such address and port are not valid are:
accept  - i2p
accept  - socks5
enum_if - tcp

libtorrent may sometimes try to listen on port 0, if all other ports failed.
Port 0 asks the operating system to pick a port that's free). If that fails
you may see a `listen_failed_alert`__ with port 0 even if you didn't ask to
listen on it.


__ reference-Alerts.html#alert
__ reference-Session.html#session
__ reference-Alerts.html#alert
__ reference-Alerts.html#listen_failed_alert


.. parsed-literal::
	

	struct listen_failed_alert final : alert
	{
	   std::string **message** () const override;
	   char const* **listen_interface** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status | alert_category::error;
	   error_code const error;
	   operation_t op;
	   lt::socket_type_t const socket_type;
	   aux::noexcept_movable<lt::address> address;
	   int const port;
	};

.. raw:: html

	<a name="listen_interface()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D%22+could+be+improved">report issue</a>]</span>



listen_interface()
..................

.. parsed-literal::
	
	char const* **listen_interface** () const;
	

the network device libtorrent attempted to listen on, or the IP address



.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error the system returned
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the underlying operation that failed
	


.. raw:: html

	<a name="socket_type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved">report issue</a>]</span>


socket_type
	the type of listen socket this `alert`__ refers to.
	

__ reference-Alerts.html#alert

.. raw:: html

	<a name="address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Baddress%5D%22+could+be+improved">report issue</a>]</span>


address
	the address libtorrent attempted to listen on
	see `alert`__ documentation for validity of this value
	

__ reference-Alerts.html#alert

.. raw:: html

	<a name="port"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bport%5D%22+could+be+improved">report issue</a>]</span>


port
	the port libtorrent attempted to listen on
	see `alert`__ documentation for validity of this value
	

__ reference-Alerts.html#alert

.. raw:: html

	<a name="listen_succeeded_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_succeeded_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_succeeded_alert%22+could+be+improved">report issue</a>]</span>



listen_succeeded_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when the listen port succeeds to be opened on a
particular interface. ``address`` and ``port`` is the endpoint that
successfully was opened for listening.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct listen_succeeded_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   aux::noexcept_movable<lt::address> address;
	   int const port;
	   lt::socket_type_t const socket_type;
	};

.. raw:: html

	<a name="address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Baddress%5D%22+could+be+improved">report issue</a>]</span>


address
	the address libtorrent ended up listening on. This address
	refers to the local interface.
	


.. raw:: html

	<a name="port"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bport%5D%22+could+be+improved">report issue</a>]</span>


port
	the port libtorrent ended up listening on.
	


.. raw:: html

	<a name="socket_type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved">report issue</a>]</span>


socket_type
	the type of listen socket this `alert`__ refers to.
	

__ reference-Alerts.html#alert

.. raw:: html

	<a name="portmap_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_error_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_error_alert%22+could+be+improved">report issue</a>]</span>



portmap_error_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a NAT router was successfully found but some
part of the port mapping request failed. It contains a text message that
may help the user figure out what is wrong. This `alert`__ is not generated in
case it appears the client is not running on a NAT:ed network or if it
appears there is no NAT router that can be remote controlled to add port
mappings.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct portmap_error_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::port_mapping
	   | alert_category::error;
	   port_mapping_t const mapping;
	   portmap_transport map_transport;
	   aux::noexcept_movable<address> local_address;
	   error_code const error;
	};

.. raw:: html

	<a name="mapping"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmapping%5D%22+could+be+improved">report issue</a>]</span>


mapping
	refers to the mapping index of the port map that failed, i.e.
	the index returned from add_mapping().
	


.. raw:: html

	<a name="map_transport"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmap_transport%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmap_transport%5D%22+could+be+improved">report issue</a>]</span>


map_transport
	UPnP or NAT-PMP
	


.. raw:: html

	<a name="local_address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved">report issue</a>]</span>


local_address
	the local network the port mapper is running on
	


.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	tells you what failed.
	


.. raw:: html

	<a name="portmap_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_alert%22+could+be+improved">report issue</a>]</span>



portmap_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a NAT router was successfully found and
a port was successfully mapped on it. On a NAT:ed network with a NAT-PMP
capable router, this is typically generated once when mapping the TCP
port and, if DHT is enabled, when the UDP port is mapped.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct portmap_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::port_mapping;
	   port_mapping_t const mapping;
	   int const external_port;
	   portmap_protocol const map_protocol;
	   portmap_transport const map_transport;
	   aux::noexcept_movable<address> local_address;
	};

.. raw:: html

	<a name="mapping"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bmapping%5D%22+could+be+improved">report issue</a>]</span>


mapping
	refers to the mapping index of the port map that failed, i.e.
	the index returned from add_mapping().
	


.. raw:: html

	<a name="external_port"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bexternal_port%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bexternal_port%5D%22+could+be+improved">report issue</a>]</span>


external_port
	the external port allocated for the mapping.
	


.. raw:: html

	<a name="local_address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Blocal_address%5D%22+could+be+improved">report issue</a>]</span>


local_address
	the local network the port mapper is running on
	


.. raw:: html

	<a name="portmap_log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_log_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_log_alert%22+could+be+improved">report issue</a>]</span>



portmap_log_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated to log informational events related to either
UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP
and 1 = UPnP). Displaying these messages to an end user is only useful
for debugging the UPnP or NAT-PMP implementation. This `alert`__ is only
posted if the alert_category::port_mapping_log flag is enabled in
the `alert`__ mask.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct portmap_log_alert final : alert
	{
	   std::string **message** () const override;
	   char const* **log_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::port_mapping_log;
	   portmap_transport const map_transport;
	   aux::noexcept_movable<address> local_address;
	};

.. raw:: html

	<a name="log_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



log_message()
.............

.. parsed-literal::
	
	char const* **log_message** () const;
	

the message associated with this log line



.. raw:: html

	<a name="local_address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blocal_address%5D%22+could+be+improved">report issue</a>]</span>


local_address
	the local network the port mapper is running on
	


.. raw:: html

	<a name="fastresume_rejected_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+fastresume_rejected_alert&labels=documentation&body=Documentation+under+heading+%22class+fastresume_rejected_alert%22+could+be+improved">report issue</a>]</span>



fastresume_rejected_alert
-------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a fast resume file has been passed to
`add_torrent()`__ but the files on disk did not match the fast resume file.
The error_code explains the reason why the resume file was rejected.


__ reference-Alerts.html#alert
__ reference-Session.html#add_torrent()


.. parsed-literal::
	

	struct fastresume_rejected_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **file_path** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status
	   | alert_category::error;
	   error_code error;
	   operation_t op;
	};

.. raw:: html

	<a name="file_path()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved">report issue</a>]</span>



file_path()
...........

.. parsed-literal::
	
	char const* **file_path** () const;
	

If the error happened to a specific file, this returns the path to it.



.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the underlying operation that failed
	


.. raw:: html

	<a name="peer_blocked_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_blocked_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_blocked_alert%22+could+be+improved">report issue</a>]</span>



peer_blocked_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when an incoming peer connection, or a peer that's about to be added
to our peer list, is blocked for some reason. This could be any of:

* the IP filter
* i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)
* the port filter
* the peer has a low port and ``no_connect_privileged_ports`` is enabled
* the protocol of the peer is blocked (uTP/TCP blocking)


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_blocked_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   enum reason_t
	   {
	      ip_filter,
	      port_filter,
	      i2p_mixed,
	      privileged_ports,
	      utp_disabled,
	      tcp_disabled,
	      invalid_local_interface,
	      ssrf_mitigation,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::ip_block;
	   int const reason;
	};

.. raw:: html

	<a name="reason_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+reason_t&labels=documentation&body=Documentation+under+heading+%22enum+reason_t%22+could+be+improved">report issue</a>]</span>



enum reason_t
.............

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+-------------------------+-------+-------------+
| name                    | value | description |
+=========================+=======+=============+
| ip_filter               | 0     |             |
+-------------------------+-------+-------------+
| port_filter             | 1     |             |
+-------------------------+-------+-------------+
| i2p_mixed               | 2     |             |
+-------------------------+-------+-------------+
| privileged_ports        | 3     |             |
+-------------------------+-------+-------------+
| utp_disabled            | 4     |             |
+-------------------------+-------+-------------+
| tcp_disabled            | 5     |             |
+-------------------------+-------+-------------+
| invalid_local_interface | 6     |             |
+-------------------------+-------+-------------+
| ssrf_mitigation         | 7     |             |
+-------------------------+-------+-------------+



.. raw:: html

	<a name="reason"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_blocked_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_blocked_alert%3A%3A%5Breason%5D%22+could+be+improved">report issue</a>]</span>


reason
	the reason for the peer being blocked. Is one of the values from the
	`reason_t`__ enum.
	

__ reference-Alerts.html#reason_t

.. raw:: html

	<a name="dht_announce_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_announce_alert%22+could+be+improved">report issue</a>]</span>



dht_announce_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a DHT node announces to an info-hash on our
DHT node. It belongs to the ``alert_category::dht`` category.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_announce_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   aux::noexcept_movable<address> ip;
	   int port;
	   sha1_hash info_hash;
	};

.. raw:: html

	<a name="dht_get_peers_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_alert%22+could+be+improved">report issue</a>]</span>



dht_get_peers_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when a DHT node sends a ``get_peers`` message to
our DHT node. It belongs to the ``alert_category::dht`` category.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_get_peers_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   sha1_hash info_hash;
	};

.. raw:: html

	<a name="cache_flushed_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+cache_flushed_alert&labels=documentation&body=Documentation+under+heading+%22class+cache_flushed_alert%22+could+be+improved">report issue</a>]</span>



cache_flushed_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when the disk cache has been flushed for a specific
torrent as a result of a call to `torrent_handle::flush_cache()`__. This
`alert`__ belongs to the ``alert_category::storage`` category, which must be
enabled to let this `alert`__ through. The `alert`__ is also posted when removing
a torrent from the `session`__, once the outstanding cache flush is complete
and the torrent does no longer have any files open.


__ reference-Alerts.html#alert
__ reference-Torrent_Handle.html#flush_cache()
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct cache_flushed_alert final : torrent_alert
	{
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	};

.. raw:: html

	<a name="lsd_peer_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_peer_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_peer_alert%22+could+be+improved">report issue</a>]</span>



lsd_peer_alert
--------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when we receive a local service discovery message
from a peer for a torrent we're currently participating in.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct lsd_peer_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	};

.. raw:: html

	<a name="trackerid_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+trackerid_alert&labels=documentation&body=Documentation+under+heading+%22class+trackerid_alert%22+could+be+improved">report issue</a>]</span>



trackerid_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted whenever a tracker responds with a ``trackerid``.
The tracker ID is like a cookie. libtorrent will store the tracker ID
for this tracker and repeat it in subsequent announces.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct trackerid_alert final : tracker_alert
	{
	   std::string **message** () const override;
	   char const* **tracker_id** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="tracker_id()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:trackerid_alert%3A%3A%5Btracker_id%28%29%5D&labels=documentation&body=Documentation+under+heading+%22trackerid_alert%3A%3A%5Btracker_id%28%29%5D%22+could+be+improved">report issue</a>]</span>



tracker_id()
............

.. parsed-literal::
	
	char const* **tracker_id** () const;
	

The tracker ID returned by the tracker



.. raw:: html

	<a name="dht_bootstrap_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_bootstrap_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_bootstrap_alert%22+could+be+improved">report issue</a>]</span>



dht_bootstrap_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when the initial DHT bootstrap is done.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_bootstrap_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	};

.. raw:: html

	<a name="torrent_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_error_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_error_alert%22+could+be+improved">report issue</a>]</span>



torrent_error_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is posted whenever a torrent is transitioned into the error state.
If the error code is duplicate_torrent (`error_code_enum`__) error, it suggests two magnet
links ended up resolving to the same hybrid torrent. For more details,
see `BitTorrent v2 torrents`__.


__ reference-Error_Codes.html#error_code_enum
__ manual-ref.html#bittorrent-v2-torrents


.. parsed-literal::
	

	struct torrent_error_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **filename** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error | alert_category::status;
	   error_code const error;
	};

.. raw:: html

	<a name="filename()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved">report issue</a>]</span>



filename()
..........

.. parsed-literal::
	
	char const* **filename** () const;
	

the filename (or object) the error occurred on.



.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	specifies which error the torrent encountered.
	


.. raw:: html

	<a name="torrent_need_cert_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_need_cert_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_need_cert_alert%22+could+be+improved">report issue</a>]</span>



torrent_need_cert_alert
-----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is always posted for SSL torrents. This is a reminder to the client that
the torrent won't work unless `torrent_handle::set_ssl_certificate()`__ is called with
a valid certificate. Valid certificates MUST be signed by the SSL certificate
in the .torrent file.


__ reference-Torrent_Handle.html#set_ssl_certificate()


.. parsed-literal::
	

	struct torrent_need_cert_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	};

.. raw:: html

	<a name="incoming_connection_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_connection_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_connection_alert%22+could+be+improved">report issue</a>]</span>



incoming_connection_alert
-------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The incoming connection `alert`__ is posted every time we successfully accept
an incoming connection, through any mean. The most straight-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 through a Socks5 or i2p listen socket, or via an SSL listen
socket.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct incoming_connection_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer;
	   socket_type_t socket_type;
	   aux::noexcept_movable<tcp::endpoint> endpoint;
	};

.. raw:: html

	<a name="socket_type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved">report issue</a>]</span>


socket_type
	tells you what kind of socket the connection was accepted
	


.. raw:: html

	<a name="endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bendpoint%5D%22+could+be+improved">report issue</a>]</span>


endpoint
	is the IP address and port the connection came from.
	


.. raw:: html

	<a name="add_torrent_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_alert%22+could+be+improved">report issue</a>]</span>



add_torrent_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is always posted when a torrent was attempted to be added
and contains the return status of the add operation. The torrent handle of the new
torrent can be found as the ``handle`` member in the base class. If adding
the torrent failed, ``error`` contains the error code.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct add_torrent_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   add_torrent_params params;
	   error_code error;
	};

.. raw:: html

	<a name="params"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Bparams%5D%22+could+be+improved">report issue</a>]</span>


params
	This contains copies of the most important fields from the original
	`add_torrent_params`__ object, passed to `add_torrent()`__ or
	`async_add_torrent()`__. Specifically, these fields are copied:
	
	* version
	* ti
	* name
	* save_path
	* userdata
	* tracker_id
	* flags
	* info_hash
	
	the info_hash field will be updated with the info-hash of the torrent
	specified by ``ti``.
	

__ reference-Add_Torrent.html#add_torrent_params
__ reference-Session.html#add_torrent()
__ reference-Session.html#async_add_torrent()

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	set to the error, if one occurred while adding the torrent.
	


.. raw:: html

	<a name="state_update_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_update_alert&labels=documentation&body=Documentation+under+heading+%22class+state_update_alert%22+could+be+improved">report issue</a>]</span>



state_update_alert
------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is only posted when requested by the user, by calling
session::post_torrent_updates() on the `session`__. It contains the torrent
status of all torrents that changed since last time this message was
posted. Its category is ``alert_category::status``, but it's not subject to
filtering, since it's only manually posted anyway.


__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct state_update_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::status;
	   std::vector<torrent_status> status;
	};

.. raw:: html

	<a name="status"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:state_update_alert%3A%3A%5Bstatus%5D&labels=documentation&body=Documentation+under+heading+%22state_update_alert%3A%3A%5Bstatus%5D%22+could+be+improved">report issue</a>]</span>


status
	contains the torrent status of all torrents that changed since last
	time this message was posted. Note that you can map a torrent status
	to a specific torrent via its ``handle`` member. The receiving end is
	suggested to have all torrents sorted by the `torrent_handle`__ or hashed
	by it, for efficient updates.
	

__ reference-Torrent_Handle.html#torrent_handle

.. raw:: html

	<a name="session_stats_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_alert%22+could+be+improved">report issue</a>]</span>



session_stats_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The `session_stats_alert`__ is posted when the user requests `session`__ statistics by
calling `post_session_stats()`__ on the `session`__ object. This `alert`__ does not
have a category, since it's only posted in response to an API call. It
is not subject to the alert_mask filter.

the ``message()`` member function returns a string representation of the values that
properly match the line returned in ``session_stats_header_alert::message()``.

this specific output is parsed by tools/parse_session_stats.py
if this is changed, that parser should also be changed


__ reference-Alerts.html#session_stats_alert
__ reference-Session.html#session
__ reference-Session.html#post_session_stats()
__ reference-Session.html#session
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct session_stats_alert final : alert
	{
	   std::string **message** () const override;
	   span<std::int64_t const> **counters** () const;
	
	   static constexpr alert_category_t **static_category**  = {};
	};

.. raw:: html

	<a name="counters()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_alert%3A%3A%5Bcounters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_stats_alert%3A%3A%5Bcounters%28%29%5D%22+could+be+improved">report issue</a>]</span>



counters()
..........

.. parsed-literal::
	
	span<std::int64_t const> **counters** () const;
	

An array are a mix of *counters* and *gauges*, which meanings can be
queries via the `session_stats_metrics()`__ function on the `session`__. The
mapping from a specific metric to an index into this array is constant
for a specific version of libtorrent, but may differ for other
versions. The intended usage is to request the mapping, i.e. call
`session_stats_metrics()`__, once on startup, and then use that mapping to
interpret these values throughout the process' runtime.

For more information, see the `session statistics`__ section.


__ reference-Stats.html#session_stats_metrics()
__ reference-Session.html#session
__ reference-Stats.html#session_stats_metrics()
__ manual-ref.html#session-statistics

.. raw:: html

	<a name="dht_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_error_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_error_alert%22+could+be+improved">report issue</a>]</span>



dht_error_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted when something fails in the DHT. This is not necessarily a fatal
error, but it could prevent proper operation




.. parsed-literal::
	

	struct dht_error_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error | alert_category::dht;
	   error_code error;
	   operation_t op;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error code
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the operation that failed
	


.. raw:: html

	<a name="dht_immutable_item_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_immutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_immutable_item_alert%22+could+be+improved">report issue</a>]</span>



dht_immutable_item_alert
------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted as a response to a call to session::get_item(),
specifically the overload for looking up immutable items in the DHT.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_immutable_item_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   sha1_hash target;
	   entry item;
	};

.. raw:: html

	<a name="target"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Btarget%5D%22+could+be+improved">report issue</a>]</span>


target
	the target hash of the immutable item. This must
	match the SHA-1 hash of the bencoded form of ``item``.
	


.. raw:: html

	<a name="item"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved">report issue</a>]</span>


item
	the data for this item
	


.. raw:: html

	<a name="dht_mutable_item_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_mutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_mutable_item_alert%22+could+be+improved">report issue</a>]</span>



dht_mutable_item_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted as a response to a call to session::get_item(),
specifically the overload for looking up mutable items in the DHT.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_mutable_item_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   std::array<char, 32> key;
	   std::array<char, 64> signature;
	   std::int64_t seq;
	   std::string salt;
	   entry item;
	   bool authoritative;
	};

.. raw:: html

	<a name="key"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bkey%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bkey%5D%22+could+be+improved">report issue</a>]</span>


key
	the public key that was looked up
	


.. raw:: html

	<a name="signature"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsignature%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsignature%5D%22+could+be+improved">report issue</a>]</span>


signature
	the signature of the data. This is not the signature of the
	plain encoded form of the item, but it includes the sequence number
	and possibly the hash as well. See the dht_store document for more
	information. This is primarily useful for echoing back in a store
	request.
	


.. raw:: html

	<a name="seq"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bseq%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bseq%5D%22+could+be+improved">report issue</a>]</span>


seq
	the sequence number of this item
	


.. raw:: html

	<a name="salt"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsalt%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsalt%5D%22+could+be+improved">report issue</a>]</span>


salt
	the salt, if any, used to lookup and store this item. If no
	salt was used, this is an empty string
	


.. raw:: html

	<a name="item"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved">report issue</a>]</span>


item
	the data for this item
	


.. raw:: html

	<a name="authoritative"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bauthoritative%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bauthoritative%5D%22+could+be+improved">report issue</a>]</span>


authoritative
	the last response for mutable data is authoritative.
	


.. raw:: html

	<a name="dht_put_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_put_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_put_alert%22+could+be+improved">report issue</a>]</span>



dht_put_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this is posted when a DHT put operation completes. This is useful if the
client is waiting for a put to complete before shutting down for instance.




.. parsed-literal::
	

	struct dht_put_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   sha1_hash target;
	   std::array<char, 32> public_key;
	   std::array<char, 64> signature;
	   std::string salt;
	   std::int64_t seq;
	   int num_success;
	};

.. raw:: html

	<a name="target"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Btarget%5D%22+could+be+improved">report issue</a>]</span>


target
	the target hash the item was stored under if this was an *immutable*
	item.
	


.. raw:: html

	<a name="public_key"></a>
	<a name="signature"></a>
	<a name="salt"></a>
	<a name="seq"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D%22+could+be+improved">report issue</a>]</span>


public_key signature salt seq
	if a mutable item was stored, these are the public key, signature,
	salt and sequence number the item was stored under.
	


.. raw:: html

	<a name="num_success"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bnum_success%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bnum_success%5D%22+could+be+improved">report issue</a>]</span>


num_success
	DHT put operation usually writes item to k nodes, maybe the node
	is stale so no response, or the node doesn't support 'put', or the
	token for write is out of date, etc. num_success is the number of
	successful responses we got from the puts.
	


.. raw:: html

	<a name="i2p_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+i2p_alert&labels=documentation&body=Documentation+under+heading+%22class+i2p_alert%22+could+be+improved">report issue</a>]</span>



i2p_alert
---------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is used to report errors in the i2p SAM connection


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct i2p_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   error_code error;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22i2p_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error that occurred in the i2p SAM connection
	


.. raw:: html

	<a name="dht_outgoing_get_peers_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_outgoing_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_outgoing_get_peers_alert%22+could+be+improved">report issue</a>]</span>



dht_outgoing_get_peers_alert
----------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is generated when we send a get_peers request
It belongs to the ``alert_category::dht`` category.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_outgoing_get_peers_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   sha1_hash info_hash;
	   sha1_hash obfuscated_info_hash;
	   aux::noexcept_movable<udp::endpoint> endpoint;
	};

.. raw:: html

	<a name="info_hash"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D%22+could+be+improved">report issue</a>]</span>


info_hash
	the info_hash of the torrent we're looking for peers for.
	


.. raw:: html

	<a name="obfuscated_info_hash"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D%22+could+be+improved">report issue</a>]</span>


obfuscated_info_hash
	if this was an obfuscated lookup, this is the info-hash target
	actually sent to the node.
	


.. raw:: html

	<a name="endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D%22+could+be+improved">report issue</a>]</span>


endpoint
	the endpoint we're sending this query to
	


.. raw:: html

	<a name="log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+log_alert&labels=documentation&body=Documentation+under+heading+%22class+log_alert%22+could+be+improved">report issue</a>]</span>



log_alert
---------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted by some `session`__ wide event. Its main purpose is
trouble shooting and debugging. It's not enabled by the default `alert`__
mask and is enabled by the ``alert_category::session_log`` bit.
Furthermore, it's by default disabled as a build configuration.


__ reference-Alerts.html#alert
__ reference-Session.html#session
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct log_alert final : alert
	{
	   std::string **message** () const override;
	   char const* **log_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::session_log;
	};

.. raw:: html

	<a name="log_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



log_message()
.............

.. parsed-literal::
	
	char const* **log_message** () const;
	

returns the log message



.. raw:: html

	<a name="torrent_log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_log_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_log_alert%22+could+be+improved">report issue</a>]</span>



torrent_log_alert
-----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted by torrent wide events. It's meant to be used for
trouble shooting and debugging. It's not enabled by the default `alert`__
mask and is enabled by the ``alert_category::torrent_log`` bit. By
default it is disabled as a build configuration.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct torrent_log_alert final : torrent_alert
	{
	   std::string **message** () const override;
	   char const* **log_message** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::torrent_log;
	};

.. raw:: html

	<a name="log_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



log_message()
.............

.. parsed-literal::
	
	char const* **log_message** () const;
	

returns the log message



.. raw:: html

	<a name="peer_log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_log_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_log_alert%22+could+be+improved">report issue</a>]</span>



peer_log_alert
--------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted by events specific to a peer. It's meant to be used
for trouble shooting and debugging. It's not enabled by the default `alert`__
mask and is enabled by the ``alert_category::peer_log`` bit. By
default it is disabled as a build configuration.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct peer_log_alert final : peer_alert
	{
	   std::string **message** () const override;
	   char const* **log_message** () const;
	
	   enum direction_t
	   {
	      incoming_message,
	      outgoing_message,
	      incoming,
	      outgoing,
	      info,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::peer_log;
	   char const* event_type;
	   direction_t direction;
	};

.. raw:: html

	<a name="log_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



log_message()
.............

.. parsed-literal::
	
	char const* **log_message** () const;
	

returns the log message



.. raw:: html

	<a name="direction_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved">report issue</a>]</span>



enum direction_t
................

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+------------------+-------+-------------+
| name             | value | description |
+==================+=======+=============+
| incoming_message | 0     |             |
+------------------+-------+-------------+
| outgoing_message | 1     |             |
+------------------+-------+-------------+
| incoming         | 2     |             |
+------------------+-------+-------------+
| outgoing         | 3     |             |
+------------------+-------+-------------+
| info             | 4     |             |
+------------------+-------+-------------+



.. raw:: html

	<a name="event_type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Bevent_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Bevent_type%5D%22+could+be+improved">report issue</a>]</span>


event_type
	string literal indicating the kind of event. For messages, this is the
	message name.
	


.. raw:: html

	<a name="lsd_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_error_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_error_alert%22+could+be+improved">report issue</a>]</span>



lsd_error_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted if the local service discovery socket fails to start properly.
it's categorized as ``alert_category::error``.




.. parsed-literal::
	

	struct lsd_error_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   aux::noexcept_movable<address> local_address;
	   error_code error;
	};

.. raw:: html

	<a name="local_address"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved">report issue</a>]</span>


local_address
	the local network the corresponding local service discovery is running
	on
	


.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	The error code
	


.. raw:: html

	<a name="dht_lookup"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_lookup&labels=documentation&body=Documentation+under+heading+%22class+dht_lookup%22+could+be+improved">report issue</a>]</span>



dht_lookup
----------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

holds statistics about a current `dht_lookup`__ operation.
a DHT lookup is the traversal of nodes, looking up a
set of target nodes in the DHT for retrieving and possibly
storing information in the DHT


__ reference-Alerts.html#dht_lookup


.. parsed-literal::
	

	struct dht_lookup
	{
	   char const* type;
	   int outstanding_requests;
	   int timeouts;
	   int responses;
	   int branch_factor;
	   int nodes_left;
	   int last_sent;
	   int first_timeout;
	   sha1_hash target;
	};

.. raw:: html

	<a name="type"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btype%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btype%5D%22+could+be+improved">report issue</a>]</span>


type
	string literal indicating which kind of lookup this is
	


.. raw:: html

	<a name="outstanding_requests"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Boutstanding_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Boutstanding_requests%5D%22+could+be+improved">report issue</a>]</span>


outstanding_requests
	the number of outstanding request to individual nodes
	this lookup has right now
	


.. raw:: html

	<a name="timeouts"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btimeouts%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btimeouts%5D%22+could+be+improved">report issue</a>]</span>


timeouts
	the total number of requests that have timed out so far
	for this lookup
	


.. raw:: html

	<a name="responses"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bresponses%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bresponses%5D%22+could+be+improved">report issue</a>]</span>


responses
	the total number of responses we have received for this
	lookup so far for this lookup
	


.. raw:: html

	<a name="branch_factor"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bbranch_factor%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bbranch_factor%5D%22+could+be+improved">report issue</a>]</span>


branch_factor
	the branch factor for this lookup. This is the number of
	nodes we keep outstanding requests to in parallel by default.
	when nodes time out we may increase this.
	


.. raw:: html

	<a name="nodes_left"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bnodes_left%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bnodes_left%5D%22+could+be+improved">report issue</a>]</span>


nodes_left
	the number of nodes left that could be queries for this
	lookup. Many of these are likely to be part of the trail
	while performing the lookup and would never end up actually
	being queried.
	


.. raw:: html

	<a name="last_sent"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Blast_sent%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Blast_sent%5D%22+could+be+improved">report issue</a>]</span>


last_sent
	the number of seconds ago the
	last message was sent that's still
	outstanding
	


.. raw:: html

	<a name="first_timeout"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bfirst_timeout%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bfirst_timeout%5D%22+could+be+improved">report issue</a>]</span>


first_timeout
	the number of outstanding requests
	that have exceeded the short timeout
	and are considered timed out in the
	sense that they increased the branch
	factor
	


.. raw:: html

	<a name="target"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btarget%5D%22+could+be+improved">report issue</a>]</span>


target
	the node-id or info-hash target for this lookup
	


.. raw:: html

	<a name="dht_stats_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_stats_alert%22+could+be+improved">report issue</a>]</span>



dht_stats_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

contains current DHT state. Posted in response to session::post_dht_stats().




.. parsed-literal::
	

	struct dht_stats_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = {};
	   std::vector<dht_lookup> active_requests;
	   std::vector<dht_routing_bucket> routing_table;
	   sha1_hash nid;
	   aux::noexcept_movable<udp::endpoint> local_endpoint;
	};

.. raw:: html

	<a name="active_requests"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bactive_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bactive_requests%5D%22+could+be+improved">report issue</a>]</span>


active_requests
	a vector of the currently running DHT lookups.
	


.. raw:: html

	<a name="routing_table"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Brouting_table%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Brouting_table%5D%22+could+be+improved">report issue</a>]</span>


routing_table
	contains information about every bucket in the DHT routing
	table.
	


.. raw:: html

	<a name="nid"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bnid%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bnid%5D%22+could+be+improved">report issue</a>]</span>


nid
	the node ID of the DHT node instance
	


.. raw:: html

	<a name="local_endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved">report issue</a>]</span>


local_endpoint
	the local socket this DHT node is running on
	


.. raw:: html

	<a name="incoming_request_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_request_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_request_alert%22+could+be+improved">report issue</a>]</span>



incoming_request_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted every time an incoming request from a peer is accepted and queued
up for being serviced. This `alert`__ is only posted if
the alert_category::incoming_request flag is enabled in the `alert`__
mask.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct incoming_request_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::incoming_request;
	   peer_request req;
	};

.. raw:: html

	<a name="req"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_request_alert%3A%3A%5Breq%5D&labels=documentation&body=Documentation+under+heading+%22incoming_request_alert%3A%3A%5Breq%5D%22+could+be+improved">report issue</a>]</span>


req
	the request this peer sent to us
	


.. raw:: html

	<a name="dht_log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_log_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_log_alert%22+could+be+improved">report issue</a>]</span>



dht_log_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

debug logging of the DHT when alert_category::dht_log is set in the `alert`__
mask.


__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_log_alert final : alert
	{
	   std::string **message** () const override;
	   char const* **log_message** () const;
	
	   enum dht_module_t
	   {
	      tracker,
	      node,
	      routing_table,
	      rpc_manager,
	      traversal,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht_log;
	   dht_module_t module;
	};

.. raw:: html

	<a name="log_message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved">report issue</a>]</span>



log_message()
.............

.. parsed-literal::
	
	char const* **log_message** () const;
	

the log message



.. raw:: html

	<a name="dht_module_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+dht_module_t&labels=documentation&body=Documentation+under+heading+%22enum+dht_module_t%22+could+be+improved">report issue</a>]</span>



enum dht_module_t
.................

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+---------------+-------+-------------+
| name          | value | description |
+===============+=======+=============+
| tracker       | 0     |             |
+---------------+-------+-------------+
| node          | 1     |             |
+---------------+-------+-------------+
| routing_table | 2     |             |
+---------------+-------+-------------+
| rpc_manager   | 3     |             |
+---------------+-------+-------------+
| traversal     | 4     |             |
+---------------+-------+-------------+



.. raw:: html

	<a name="module"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Bmodule%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Bmodule%5D%22+could+be+improved">report issue</a>]</span>


module
	the module, or part, of the DHT that produced this log message.
	


.. raw:: html

	<a name="dht_pkt_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_pkt_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_pkt_alert%22+could+be+improved">report issue</a>]</span>



dht_pkt_alert
-------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted every time a DHT message is sent or received. It is
only posted if the ``alert_category::dht_log`` `alert`__ category is
enabled. It contains a verbatim copy of the message.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct dht_pkt_alert final : alert
	{
	   std::string **message** () const override;
	   span<char const> **pkt_buf** () const;
	
	   enum direction_t
	   {
	      incoming,
	      outgoing,
	   };
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht_log;
	   direction_t direction;
	   aux::noexcept_movable<udp::endpoint> node;
	};

.. raw:: html

	<a name="pkt_buf()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D%22+could+be+improved">report issue</a>]</span>



pkt_buf()
.........

.. parsed-literal::
	
	span<char const> **pkt_buf** () const;
	

returns a pointer to the packet buffer and size of the packet,
respectively. This buffer is only valid for as long as the `alert`__ itself
is valid, which is owned by libtorrent and reclaimed whenever
`pop_alerts()`__ is called on the `session`__.


__ reference-Alerts.html#alert
__ reference-Session.html#pop_alerts()
__ reference-Session.html#session

.. raw:: html

	<a name="direction_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved">report issue</a>]</span>



enum direction_t
................

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

+----------+-------+-------------+
| name     | value | description |
+==========+=======+=============+
| incoming | 0     |             |
+----------+-------+-------------+
| outgoing | 1     |             |
+----------+-------+-------------+



.. raw:: html

	<a name="direction"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bdirection%5D%22+could+be+improved">report issue</a>]</span>


direction
	whether this is an incoming or outgoing packet.
	


.. raw:: html

	<a name="node"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bnode%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bnode%5D%22+could+be+improved">report issue</a>]</span>


node
	the DHT node we received this packet from, or sent this packet to
	(depending on ``direction``).
	


.. raw:: html

	<a name="dht_get_peers_reply_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_reply_alert%22+could+be+improved">report issue</a>]</span>



dht_get_peers_reply_alert
-------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

Posted when we receive a response to a DHT get_peers request.




.. parsed-literal::
	

	struct dht_get_peers_reply_alert final : alert
	{
	   std::string **message** () const override;
	   int **num_peers** () const;
	   std::vector<tcp::endpoint> **peers** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht_operation;
	   sha1_hash info_hash;
	};

.. raw:: html

	<a name="dht_direct_response_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_direct_response_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_direct_response_alert%22+could+be+improved">report issue</a>]</span>



dht_direct_response_alert
-------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This is posted exactly once for every call to session_handle::dht_direct_request.
If the request failed, `response()`__ will return a default constructed `bdecode_node`__.


__ reference-Alerts.html#response()
__ reference-Bdecoding.html#bdecode_node


.. parsed-literal::
	

	struct dht_direct_response_alert final : alert
	{
	   std::string **message** () const override;
	   bdecode_node **response** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   client_data_t userdata;
	   aux::noexcept_movable<udp::endpoint> endpoint;
	};

.. raw:: html

	<a name="picker_log_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+picker_log_alert&labels=documentation&body=Documentation+under+heading+%22class+picker_log_alert%22+could+be+improved">report issue</a>]</span>



picker_log_alert
----------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this is posted when one or more blocks are picked by the piece picker,
assuming the verbose piece picker logging is enabled (see
alert_category::picker_log).




.. parsed-literal::
	

	struct picker_log_alert final : peer_alert
	{
	   std::string **message** () const override;
	   std::vector<piece_block> **blocks** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::picker_log;
	   static constexpr picker_flags_t **partial_ratio**  = 0_bit;
	   static constexpr picker_flags_t **prioritize_partials**  = 1_bit;
	   static constexpr picker_flags_t **rarest_first_partials**  = 2_bit;
	   static constexpr picker_flags_t **rarest_first**  = 3_bit;
	   static constexpr picker_flags_t **reverse_rarest_first**  = 4_bit;
	   static constexpr picker_flags_t **suggested_pieces**  = 5_bit;
	   static constexpr picker_flags_t **prio_sequential_pieces**  = 6_bit;
	   static constexpr picker_flags_t **sequential_pieces**  = 7_bit;
	   static constexpr picker_flags_t **reverse_pieces**  = 8_bit;
	   static constexpr picker_flags_t **time_critical**  = 9_bit;
	   static constexpr picker_flags_t **random_pieces**  = 10_bit;
	   static constexpr picker_flags_t **prefer_contiguous**  = 11_bit;
	   static constexpr picker_flags_t **reverse_sequential**  = 12_bit;
	   static constexpr picker_flags_t **backup1**  = 13_bit;
	   static constexpr picker_flags_t **backup2**  = 14_bit;
	   static constexpr picker_flags_t **end_game**  = 15_bit;
	   static constexpr picker_flags_t **extent_affinity**  = 16_bit;
	   picker_flags_t const picker_flags;
	};

.. raw:: html

	<a name="picker_flags"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:picker_log_alert%3A%3A%5Bpicker_flags%5D&labels=documentation&body=Documentation+under+heading+%22picker_log_alert%3A%3A%5Bpicker_flags%5D%22+could+be+improved">report issue</a>]</span>


picker_flags
	this is a bitmask of which features were enabled for this particular
	pick. The bits are defined in the picker_flags_t enum.
	


.. raw:: html

	<a name="session_error_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_error_alert&labels=documentation&body=Documentation+under+heading+%22class+session_error_alert%22+could+be+improved">report issue</a>]</span>



session_error_alert
-------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted when the `session`__ encounters a serious error,
potentially fatal


__ reference-Alerts.html#alert
__ reference-Session.html#session


.. parsed-literal::
	

	struct session_error_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   error_code const error;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:session_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22session_error_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	The error code, if one is associated with this error
	


.. raw:: html

	<a name="dht_live_nodes_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_live_nodes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_live_nodes_alert%22+could+be+improved">report issue</a>]</span>



dht_live_nodes_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted in response to a call to session::dht_live_nodes(). It contains the
live nodes from the DHT routing table of one of the DHT nodes running
locally.




.. parsed-literal::
	

	struct dht_live_nodes_alert final : alert
	{
	   std::string **message** () const override;
	   std::vector<std::pair<sha1_hash, udp::endpoint>> **nodes** () const;
	   int **num_nodes** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht;
	   sha1_hash node_id;
	};

.. raw:: html

	<a name="num_nodes()"></a>
	<a name="nodes()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D%22+could+be+improved">report issue</a>]</span>



num_nodes() nodes()
...................

.. parsed-literal::
	
	std::vector<std::pair<sha1_hash, udp::endpoint>> **nodes** () const;
	int **num_nodes** () const;
	

the number of nodes in the routing table and the actual nodes.



.. raw:: html

	<a name="node_id"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved">report issue</a>]</span>


node_id
	the local DHT node's node-ID this routing table belongs to
	


.. raw:: html

	<a name="session_stats_header_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_header_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_header_alert%22+could+be+improved">report issue</a>]</span>



session_stats_header_alert
--------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

The session_stats_header `alert`__ is posted the first time
`post_session_stats()`__ is called

the ``message()`` member function returns a string representation of the
header that properly match the stats values string returned in
``session_stats_alert::message()``.

this specific output is parsed by tools/parse_session_stats.py
if this is changed, that parser should also be changed


__ reference-Alerts.html#alert
__ reference-Session.html#post_session_stats()


.. parsed-literal::
	

	struct session_stats_header_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = {};
	};

.. raw:: html

	<a name="dht_sample_infohashes_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_sample_infohashes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_sample_infohashes_alert%22+could+be+improved">report issue</a>]</span>



dht_sample_infohashes_alert
---------------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted as a response to a call to session::dht_sample_infohashes() with
the information from the DHT response message.




.. parsed-literal::
	

	struct dht_sample_infohashes_alert final : alert
	{
	   std::string **message** () const override;
	   std::vector<sha1_hash> **samples** () const;
	   int **num_samples** () const;
	   int **num_nodes** () const;
	   std::vector<std::pair<sha1_hash, udp::endpoint>> **nodes** () const;
	
	   static constexpr alert_category_t **static_category**  = alert_category::dht_operation;
	   sha1_hash node_id;
	   aux::noexcept_movable<udp::endpoint> endpoint;
	   time_duration const interval;
	   int const num_infohashes;
	};

.. raw:: html

	<a name="samples()"></a>
	<a name="num_samples()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D%22+could+be+improved">report issue</a>]</span>



samples() num_samples()
.......................

.. parsed-literal::
	
	std::vector<sha1_hash> **samples** () const;
	int **num_samples** () const;
	

returns the number of info-hashes returned by the node, as well as the
actual info-hashes. ``num_samples()`` is more efficient than
``samples().size()``.



.. raw:: html

	<a name="num_nodes()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D%22+could+be+improved">report issue</a>]</span>



num_nodes()
...........

.. parsed-literal::
	
	int **num_nodes** () const;
	

The total number of nodes returned by ``nodes()``.



.. raw:: html

	<a name="nodes()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D%22+could+be+improved">report issue</a>]</span>



nodes()
.......

.. parsed-literal::
	
	std::vector<std::pair<sha1_hash, udp::endpoint>> **nodes** () const;
	

This is the set of more DHT nodes returned by the request.

The information is included so that indexing nodes can perform a key
space traversal with a single RPC per node by adjusting the target
value for each RPC.



.. raw:: html

	<a name="node_id"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved">report issue</a>]</span>


node_id
	id of the node the request was sent to (and this response was received from)
	


.. raw:: html

	<a name="endpoint"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D%22+could+be+improved">report issue</a>]</span>


endpoint
	the node the request was sent to (and this response was received from)
	


.. raw:: html

	<a name="interval"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Binterval%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Binterval%5D%22+could+be+improved">report issue</a>]</span>


interval
	the interval to wait before making another request to this node
	


.. raw:: html

	<a name="num_infohashes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D%22+could+be+improved">report issue</a>]</span>


num_infohashes
	This field indicates how many info-hash keys are currently in the node's storage.
	If the value is larger than the number of returned samples it indicates that the
	indexer may obtain additional samples after waiting out the interval.
	


.. raw:: html

	<a name="block_uploaded_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_uploaded_alert&labels=documentation&body=Documentation+under+heading+%22class+block_uploaded_alert%22+could+be+improved">report issue</a>]</span>



block_uploaded_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

This `alert`__ is posted when a block intended to be sent to a peer is placed in the
send buffer. Note that if the connection is closed before the send buffer is sent,
the `alert`__ may be posted without the bytes having been sent to the peer.
It belongs to the ``alert_category::upload`` category.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct block_uploaded_alert final : peer_alert
	{
	   std::string **message** () const override;
	
	   int const block_index;
	   piece_index_t const piece_index;
	};

.. raw:: html

	<a name="alerts_dropped_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alerts_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+alerts_dropped_alert%22+could+be+improved">report issue</a>]</span>



alerts_dropped_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted to indicate to the client that some alerts were
dropped. Dropped meaning that the `alert`__ failed to be delivered to the
client. The most common cause of such failure is that the internal `alert`__
queue grew too big (controlled by alert_queue_size).


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct alerts_dropped_alert final : alert
	{
	   **static_assert** (num\_alert\_types <= abi\_alert\_count, "need to increase bitset. This is an ABI break");
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   std::bitset<abi_alert_count> dropped_alerts;
	};

.. raw:: html

	<a name="dropped_alerts"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D&labels=documentation&body=Documentation+under+heading+%22alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D%22+could+be+improved">report issue</a>]</span>


dropped_alerts
	a bitmask indicating which alerts were dropped. Each bit represents the
	`alert`__ type ID, where bit 0 represents whether any `alert`__ of type 0 has
	been dropped, and so on.
	

__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="socks5_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+socks5_alert&labels=documentation&body=Documentation+under+heading+%22class+socks5_alert%22+could+be+improved">report issue</a>]</span>



socks5_alert
------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted with SOCKS5 related errors, when a SOCKS5 proxy is
configured. It's enabled with the alert_category::error `alert`__ category.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert


.. parsed-literal::
	

	struct socks5_alert final : alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   error_code error;
	   operation_t op;
	   aux::noexcept_movable<tcp::endpoint> ip;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the operation that failed
	


.. raw:: html

	<a name="ip"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bip%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bip%5D%22+could+be+improved">report issue</a>]</span>


ip
	the endpoint configured as the proxy
	


.. raw:: html

	<a name="file_prio_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_prio_alert&labels=documentation&body=Documentation+under+heading+%22class+file_prio_alert%22+could+be+improved">report issue</a>]</span>



file_prio_alert
---------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

posted when a `prioritize_files()`__ or `file_priority()`__ update of the file
priorities complete, which requires a round-trip to the disk thread.

If the disk operation fails this `alert`__ won't be posted, but a
`file_error_alert`__ is posted instead, and the torrent is stopped.


__ reference-Torrent_Handle.html#prioritize_files()
__ reference-Torrent_Handle.html#file_priority()
__ reference-Alerts.html#alert
__ reference-Alerts.html#file_error_alert


.. parsed-literal::
	

	struct file_prio_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	   error_code error;
	   operation_t op;
	};

.. raw:: html

	<a name="error"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Berror%5D%22+could+be+improved">report issue</a>]</span>


error
	the error
	


.. raw:: html

	<a name="op"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Bop%5D%22+could+be+improved">report issue</a>]</span>


op
	the operation that failed
	


.. raw:: html

	<a name="oversized_file_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+oversized_file_alert&labels=documentation&body=Documentation+under+heading+%22class+oversized_file_alert%22+could+be+improved">report issue</a>]</span>



oversized_file_alert
--------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ may be posted when the initial checking of resume data and files
on disk (just existence, not piece hashes) completes. If a file belonging
to the torrent is found on disk, but is larger than the file in the
torrent, that's when this `alert`__ is posted.
the client may want to call `truncate_files()`__ in that case, or perhaps
interpret it as a sign that some other file is in the way, that shouldn't
be overwritten.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Core.html#truncate_files()


.. parsed-literal::
	

	struct oversized_file_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::storage;
	};

.. raw:: html

	<a name="torrent_conflict_alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_conflict_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_conflict_alert%22+could+be+improved">report issue</a>]</span>



torrent_conflict_alert
----------------------

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

this `alert`__ is posted when two separate torrents (magnet links) resolve to
the same torrent, thus causing the same torrent being added twice. In
that case, both torrents enter an error state with ``duplicate_torrent``
as the error code. This `alert`__ is posted containing the metadata. For more
information, see `BitTorrent v2 torrents`__.
The torrent this `alert`__ originated from was the one that downloaded the

metadata (i.e. the `handle` member from the `torrent_alert`__ base class).


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ manual-ref.html#bittorrent-v2-torrents
__ reference-Alerts.html#alert
__ reference-Alerts.html#torrent_alert


.. parsed-literal::
	

	struct torrent_conflict_alert final : torrent_alert
	{
	   std::string **message** () const override;
	
	   static constexpr alert_category_t **static_category**  = alert_category::error;
	   torrent_handle conflicting_torrent;
	   std::shared_ptr<torrent_info> metadata;
	};

.. raw:: html

	<a name="conflicting_torrent"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D%22+could+be+improved">report issue</a>]</span>


conflicting_torrent
	the handle to the torrent in conflict. The swarm associated with this
	torrent handle did not download the metadata, but the downloaded
	metadata collided with this swarm's info-hash.
	


.. raw:: html

	<a name="metadata"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bmetadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bmetadata%5D%22+could+be+improved">report issue</a>]</span>


metadata
	the metadata that was received by one of the torrents in conflict.
	One way to resolve the conflict is to remove both failing torrents
	and re-add it using this metadata
	


.. raw:: html

	<a name="alert"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alert&labels=documentation&body=Documentation+under+heading+%22class+alert%22+could+be+improved">report issue</a>]</span>



alert
-----

Declared in "`libtorrent/alert.hpp`__"


__ include/libtorrent/alert.hpp

The ``alert`` class is the base class that specific messages are derived from.
`alert`__ types are not copyable, and cannot be constructed by the client. The
pointers returned by libtorrent are short lived (the details are described
under `session_handle::pop_alerts()`__)


__ reference-Alerts.html#alert
__ reference-Session.html#pop_alerts()


.. parsed-literal::
	

	struct alert
	{
	   time_point **timestamp** () const;
	   virtual int **type** () const noexcept = 0;
	   virtual char const* **what** () const noexcept = 0;
	   virtual std::string **message** () const = 0;
	   virtual alert_category_t **category** () const noexcept = 0;
	
	   static constexpr alert_category_t **error_notification**  = 0_bit;
	   static constexpr alert_category_t **peer_notification**  = 1_bit;
	   static constexpr alert_category_t **port_mapping_notification**  = 2_bit;
	   static constexpr alert_category_t **storage_notification**  = 3_bit;
	   static constexpr alert_category_t **tracker_notification**  = 4_bit;
	   static constexpr alert_category_t **connect_notification**  = 5_bit;
	   static constexpr alert_category_t **status_notification**  = 6_bit;
	   static constexpr alert_category_t **ip_block_notification**  = 8_bit;
	   static constexpr alert_category_t **performance_warning**  = 9_bit;
	   static constexpr alert_category_t **dht_notification**  = 10_bit;
	   static constexpr alert_category_t **session_log_notification**  = 13_bit;
	   static constexpr alert_category_t **torrent_log_notification**  = 14_bit;
	   static constexpr alert_category_t **peer_log_notification**  = 15_bit;
	   static constexpr alert_category_t **incoming_request_notification**  = 16_bit;
	   static constexpr alert_category_t **dht_log_notification**  = 17_bit;
	   static constexpr alert_category_t **dht_operation_notification**  = 18_bit;
	   static constexpr alert_category_t **port_mapping_log_notification**  = 19_bit;
	   static constexpr alert_category_t **picker_log_notification**  = 20_bit;
	   static constexpr alert_category_t **file_progress_notification**  = 21_bit;
	   static constexpr alert_category_t **piece_progress_notification**  = 22_bit;
	   static constexpr alert_category_t **upload_notification**  = 23_bit;
	   static constexpr alert_category_t **block_progress_notification**  = 24_bit;
	   static constexpr alert_category_t **all_categories**  = alert_category_t::all();
	};

.. raw:: html

	<a name="timestamp()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btimestamp%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btimestamp%28%29%5D%22+could+be+improved">report issue</a>]</span>



timestamp()
...........

.. parsed-literal::
	
	time_point **timestamp** () const;
	

a timestamp is automatically created in the constructor



.. raw:: html

	<a name="type()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btype%28%29%5D%22+could+be+improved">report issue</a>]</span>



type()
......

.. parsed-literal::
	
	virtual int **type** () const noexcept = 0;
	

returns an integer that is unique to this `alert`__ type. It can be
compared against a specific `alert`__ by querying a static constant called ``alert_type``
in the `alert`__. It can be used to determine the run-time type of an alert* in
order to cast to that `alert`__ type and access specific members.

e.g:

.. code:: c++

	std::vector<alert*> alerts;
	ses.pop_alerts(&alerts);
	for (alert* a : alerts) {
		switch (a->type()) {

			case read_piece_alert::alert_type:
			{
				auto* p = static_cast<read_piece_alert*>(a);
				if (p->ec) {
					// read_piece failed
					break;
				}
				// use p
				break;
			}
			case file_renamed_alert::alert_type:
			{
				// etc...
			}
		}
	}


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="what()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bwhat%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bwhat%28%29%5D%22+could+be+improved">report issue</a>]</span>



what()
......

.. parsed-literal::
	
	virtual char const* **what** () const noexcept = 0;
	

returns a string literal describing the type of the `alert`__. It does
not include any information that might be bundled with the `alert`__.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="message()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved">report issue</a>]</span>



message()
.........

.. parsed-literal::
	
	virtual std::string **message** () const = 0;
	

generate a string describing the `alert`__ and the information bundled
with it. This is mainly intended for debug and development use. It is not suitable
to use this for applications that may be localized. Instead, handle each `alert`__
type individually and extract and render the information from the `alert`__ depending
on the locale.


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="category()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bcategory%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bcategory%28%29%5D%22+could+be+improved">report issue</a>]</span>



category()
..........

.. parsed-literal::
	
	virtual alert_category_t **category** () const noexcept = 0;
	

returns a bitmask specifying which categories this `alert`__ belong to.


__ reference-Alerts.html#alert

.. raw:: html

	<a name="operation_name()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:operation_name%28%29&labels=documentation&body=Documentation+under+heading+%22operation_name%28%29%22+could+be+improved">report issue</a>]</span>



operation_name()
----------------

Declared in "`libtorrent/operations.hpp`__"


__ include/libtorrent/operations.hpp

.. parsed-literal::
	
	char const* **operation_name** (operation\_t op);
	

maps an operation id (from `peer_error_alert`__ and `peer_disconnected_alert`__)
to its name. See `operation_t`__ for the constants


__ reference-Alerts.html#peer_error_alert
__ reference-Alerts.html#peer_disconnected_alert
__ reference-Alerts.html#operation_t

.. raw:: html

	<a name="alert_cast()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_cast%28%29&labels=documentation&body=Documentation+under+heading+%22alert_cast%28%29%22+could+be+improved">report issue</a>]</span>



alert_cast()
------------

Declared in "`libtorrent/alert.hpp`__"


__ include/libtorrent/alert.hpp

.. parsed-literal::
	
	template <typename T> T* **alert_cast** (alert\* a);
	template <typename T> T const* **alert_cast** (alert const\* a);
	

When you get an `alert`__, you can use ``alert_cast<>`` to attempt to cast the
pointer to a specific `alert`__ type, in order to query it for more
information.

.. note::
  ``alert_cast<>`` can only cast to an exact `alert`__ type, not a base class


__ reference-Alerts.html#alert
__ reference-Alerts.html#alert
__ reference-Alerts.html#alert

.. raw:: html

	<a name="operation_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+operation_t&labels=documentation&body=Documentation+under+heading+%22enum+operation_t%22+could+be+improved">report issue</a>]</span>



enum operation_t
----------------

Declared in "`libtorrent/operations.hpp`__"


__ include/libtorrent/operations.hpp

+---------------------+-------+-------------------------------------------------------------------------+
| name                | value | description                                                             |
+=====================+=======+=========================================================================+
| unknown             | 0     | the error was unexpected and it is unknown which operation caused it    |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| bittorrent          | 1     | this is used when the bittorrent logic                                  |
|                     |       | determines to disconnect                                                |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| iocontrol           | 2     | a call to iocontrol failed                                              |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| getpeername         | 3     | a call to ``getpeername()`` failed (querying the remote IP of a         |
|                     |       | connection)                                                             |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| getname             | 4     | a call to getname failed (querying the local IP of a                    |
|                     |       | connection)                                                             |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| alloc_recvbuf       | 5     | an attempt to allocate a receive buffer failed                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| alloc_sndbuf        | 6     | an attempt to allocate a send buffer failed                             |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_write          | 7     | writing to a file failed                                                |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_read           | 8     | reading from a file failed                                              |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file                | 9     | a non-read and non-write file operation failed                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_write          | 10    | a socket write operation failed                                         |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_read           | 11    | a socket read operation failed                                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_open           | 12    | a call to open(), to create a socket socket failed                      |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_bind           | 13    | a call to bind() on a socket failed                                     |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| available           | 14    | an attempt to query the number of bytes available to read from a socket |
|                     |       | failed                                                                  |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| encryption          | 15    | a call related to bittorrent protocol encryption failed                 |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| connect             | 16    | an attempt to connect a socket failed                                   |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| ssl_handshake       | 17    | establishing an SSL connection failed                                   |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| get_interface       | 18    | a connection failed to satisfy the bind interface setting               |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_listen         | 19    | a call to listen() on a socket                                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_bind_to_device | 20    | a call to the ioctl to bind a socket to a specific network device or    |
|                     |       | adapter                                                                 |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_accept         | 21    | a call to accept() on a socket                                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| parse_address       | 22    | convert a string into a valid network address                           |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| enum_if             | 23    | enumeration network devices or adapters                                 |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_stat           | 24    | invoking stat() on a file                                               |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_copy           | 25    | copying a file                                                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_fallocate      | 26    | allocating storage for a file                                           |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_hard_link      | 27    | creating a hard link                                                    |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_remove         | 28    | removing a file                                                         |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_rename         | 29    | renaming a file                                                         |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_open           | 30    | opening a file                                                          |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| mkdir               | 31    | creating a directory                                                    |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| check_resume        | 32    | check fast resume data against files on disk                            |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| exception           | 33    | an unknown exception                                                    |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| alloc_cache_piece   | 34    | allocate space for a piece in the cache                                 |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| partfile_move       | 35    | move a part-file                                                        |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| partfile_read       | 36    | read from a part file                                                   |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| partfile_write      | 37    | write to a part-file                                                    |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| hostname_lookup     | 38    | a hostname lookup                                                       |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| symlink             | 39    | create or read a symlink                                                |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| handshake           | 40    | handshake with a peer or server                                         |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| sock_option         | 41    | set socket option                                                       |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| enum_route          | 42    | enumeration of network routes                                           |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_seek           | 43    | moving read/write position in a file, `operation_t::hostname_lookup`__  |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| timer               | 44    | an async wait operation on a timer                                      |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_mmap           | 45    | call to mmap() (or windows counterpart)                                 |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+
| file_truncate       | 46    | call to ftruncate() (or SetEndOfFile() on windows)                      |
|                     |       |                                                                         |
+---------------------+-------+-------------------------------------------------------------------------+


__ reference-Alerts.html#hostname_lookup

.. raw:: html

	<a name="int"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved">report issue</a>]</span>



int
---

Declared in "`libtorrent/alert_types.hpp`__"


__ include/libtorrent/alert_types.hpp

.. raw:: html

	<a name="int::user_alert_id"></a>

user_alert_id
	user defined alerts should use IDs greater than this
	


.. raw:: html

	<a name="int::num_alert_types"></a>

num_alert_types
	this constant represents "max_alert_index" + 1
	



.. raw:: html

	<a name="alert_category_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_category_t&labels=documentation&body=Documentation+under+heading+%22alert_category_t%22+could+be+improved">report issue</a>]</span>



alert_category_t
----------------

Declared in "`libtorrent/alert.hpp`__"


__ include/libtorrent/alert.hpp

.. raw:: html

	<a name="alert_category_t::error"></a>

error
	Enables alerts that report an error. This includes:
	
	* tracker errors
	* tracker warnings
	* file errors
	* resume data failures
	* web seed errors
	* .torrent files errors
	* listen socket errors
	* port mapping errors
	


.. raw:: html

	<a name="alert_category_t::peer"></a>

peer
	Enables alerts when peers send invalid requests, get banned or
	snubbed.
	


.. raw:: html

	<a name="alert_category_t::port_mapping"></a>

port_mapping
	Enables alerts for port mapping events. For NAT-PMP and UPnP.
	


.. raw:: html

	<a name="alert_category_t::storage"></a>

storage
	Enables alerts for events related to the storage. File errors and
	synchronization events for moving the storage, renaming files etc.
	


.. raw:: html

	<a name="alert_category_t::tracker"></a>

tracker
	Enables all tracker events. Includes announcing to trackers,
	receiving responses, warnings and errors.
	


.. raw:: html

	<a name="alert_category_t::connect"></a>

connect
	Low level alerts for when peers are connected and disconnected.
	


.. raw:: html

	<a name="alert_category_t::status"></a>

status
	Enables alerts for when a torrent or the `session`__ changes state.
	

	__ reference-Session.html#session

.. raw:: html

	<a name="alert_category_t::ip_block"></a>

ip_block
	Alerts when a peer is blocked by the ip blocker or port blocker.
	


.. raw:: html

	<a name="alert_category_t::performance_warning"></a>

performance_warning
	Alerts when some limit is reached that might limit the download
	or upload rate.
	


.. raw:: html

	<a name="alert_category_t::dht"></a>

dht
	Alerts on events in the DHT node. For incoming searches or
	bootstrapping being done etc.
	


.. raw:: html

	<a name="alert_category_t::stats"></a>

stats
	If you enable these alerts, you will receive a stats_alert
	approximately once every second, for every active torrent.
	These alerts contain all statistics `counters`__ for the interval since
	the lasts stats `alert`__.
	

	__ reference-Stats.html#counters
	__ reference-Alerts.html#alert

.. raw:: html

	<a name="alert_category_t::session_log"></a>

session_log
	Enables debug logging alerts. These are available unless libtorrent
	was built with logging disabled (``TORRENT_DISABLE_LOGGING``). The
	alerts being posted are `log_alert`__ and are `session`__ wide.
	

	__ reference-Alerts.html#log_alert
	__ reference-Session.html#session

.. raw:: html

	<a name="alert_category_t::torrent_log"></a>

torrent_log
	Enables debug logging alerts for torrents. These are available
	unless libtorrent was built with logging disabled
	(``TORRENT_DISABLE_LOGGING``). The alerts being posted are
	`torrent_log_alert`__ and are torrent wide debug events.
	

	__ reference-Alerts.html#torrent_log_alert

.. raw:: html

	<a name="alert_category_t::peer_log"></a>

peer_log
	Enables debug logging alerts for peers. These are available unless
	libtorrent was built with logging disabled
	(``TORRENT_DISABLE_LOGGING``). The alerts being posted are
	`peer_log_alert`__ and low-level peer events and messages.
	

	__ reference-Alerts.html#peer_log_alert

.. raw:: html

	<a name="alert_category_t::incoming_request"></a>

incoming_request
	enables the `incoming_request_alert`__.
	

	__ reference-Alerts.html#incoming_request_alert

.. raw:: html

	<a name="alert_category_t::dht_log"></a>

dht_log
	enables `dht_log_alert`__, debug logging for the DHT
	

	__ reference-Alerts.html#dht_log_alert

.. raw:: html

	<a name="alert_category_t::dht_operation"></a>

dht_operation
	enable events from pure dht operations not related to torrents
	


.. raw:: html

	<a name="alert_category_t::port_mapping_log"></a>

port_mapping_log
	enables port mapping log events. This log is useful
	for debugging the UPnP or NAT-PMP implementation
	


.. raw:: html

	<a name="alert_category_t::picker_log"></a>

picker_log
	enables verbose logging from the piece picker.
	


.. raw:: html

	<a name="alert_category_t::file_progress"></a>

file_progress
	alerts when files complete downloading
	


.. raw:: html

	<a name="alert_category_t::piece_progress"></a>

piece_progress
	alerts when pieces complete downloading or fail hash check
	


.. raw:: html

	<a name="alert_category_t::upload"></a>

upload
	alerts when we upload blocks to other peers
	


.. raw:: html

	<a name="alert_category_t::block_progress"></a>

block_progress
	alerts on individual blocks being requested, downloading, finished,
	rejected, time-out and cancelled. This is likely to post alerts at a
	high rate.
	


.. raw:: html

	<a name="alert_category_t::all"></a>

all
	The full bitmask, representing all available categories.
	
	since the enum is signed, make sure this isn't
	interpreted as -1. For instance, boost.python
	does that and fails when assigning it to an
	unsigned parameter.
	





.. _`BEP 3`: https://www.bittorrent.org/beps/bep_0003.html
.. _`BEP 17`: https://www.bittorrent.org/beps/bep_0017.html
.. _extensions: manual-ref.html#extensions
.. _`BEP 52`: https://www.bittorrent.org/beps/bep_0052.html
.. _`BEP 19`: https://www.bittorrent.org/beps/bep_0019.html
.. _`BEP 38`: https://www.bittorrent.org/beps/bep_0038.html
.. _`rate based choking`: manual-ref.html#rate-based-choking
.. _`BEP 42`: https://www.bittorrent.org/beps/bep_0042.html
