haiku/docs/user/netservices
Niels Sascha Reedijk 1e22817dfb NetServices: add the BExclusiveBorrow<T> smart pointer
This smart pointer is designed to help with putting some explicitness and
safety around the case where someone will use their own object that implements
the BDataIO interface to store the body of a network request. By default,
BDataIO objects do not require or enforce thread safety. Since accessing these
unsynchronized objects between two threads is undefined behavior, it should be
explicitly discouraged.

The BExclusiveBorrow/BBorrow smart pointer helper helps solve that by enforcing
the limitations on using an unsynchronized object in two threads. When used
correctly, there is a runtime check on incorrect use by the developer. This
should help write better code.

The design is based on shared_ptr, including having an admin block akin the
control block, that manages the internal object. This type-erased admin block
has the advantage that it allows the owner to have a different type than the
borrower. It also handles cases where the lifetime of the borrower is longer
than the owner: the borrower can continue to use the object until they want to
return it, after which it will be cleaned up. This will make it possible to do
some fire and forget pattern in the network services kit, where someone may
just wants to create a file and borrow it to the network request, and care
about further processing the file in the future.

Change-Id: Ie9b7e7472c868b60f663b4db4fa449d421e447eb
2022-09-04 06:54:37 +01:00
..
ErrorsExt.dox NetServices: Add skeleton BHttpSession class and its documentation 2021-12-17 17:40:15 +00:00
ExclusiveBorrow.dox NetServices: add the BExclusiveBorrow<T> smart pointer 2022-09-04 06:54:37 +01:00
HttpFields.dox NetServices: Rework parsing of content-length and move to HttpParser 2022-08-08 07:58:45 +01:00
HttpRequest.dox NetServices: Remove BHttpRequest::SerializeTo(BDataIO*) 2022-08-07 07:17:38 +01:00
HttpResult.dox NetServices: Implement BHttpStatusCode, BHttpStatusClass and Redirects 2022-04-23 18:30:38 +01:00
HttpSession.dox NetServices: Implement controls on the number of concurrent requests. 2022-07-27 09:02:09 +01:00
HttpTime.dox NetServices: Implement BHttpTime, parse_http_time() and format_http_time(). 2022-05-08 06:59:51 +01:00
NetServicesDefs.dox NetServices: Add debugging constants and messages 2022-08-14 14:53:48 +01:00