|
| | network_io_base () noexcept |
| |
| template<typename T , traits::enable_when::same_any_of< T, string_view, wstring_view, progmem_string_view > = true> |
| tdsl::expected< tdsl::traits::true_type, int > | connect (T host, tdsl::uint16_t port) noexcept |
| | Connect to host: port.
|
| |
| tdsl::uint32_t | abandon_response (tdsl::uint32_t processed) noexcept |
| | Give up on the response currently being received.
|
| |
| bool | is_response_too_large () const noexcept |
| | Whether the last response had an item (e.g.
|
| |
| tdsl::uint32_t | do_receive_tds_pdu () noexcept |
| | Receive one, complete TDS PDU.
|
| |
| tdsl::detail::e_send_status | do_send_tds_pdu (tdsl::detail::e_tds_message_type mtype) noexcept |
| | Send contents of the message buffer in one or more TDS PDU's, depending on negotiated packet size.
|
| |
| void | discard_tx () noexcept |
| | Discard the message being built in the network buffer, including its overflow state.
|
| |
| template<typename T > |
| void | do_write (tdsl::span< T > data) noexcept |
| | Append data to network buffer.
|
| |
| tdsl::size_t | do_get_write_offset () noexcept |
| | Get current write offset.
|
| |
| template<typename T > |
| void | do_write (tdsl::size_t offset, tdsl::span< T > data) noexcept |
| | Append data to network buffer, starting from offset.
|
| |
| void | register_packet_data_callback (tds_packet_data_callback::function_type cb, void *user_ptr) noexcept |
| | Set TDS packet data callback.
|
| |
| void | set_tds_packet_size (tdsl::uint16_t value) noexcept |
| | Update negotiated packet size.
|
| |
| void | set_connection_timeout_params (tdsl::uint16_t attempts, tdsl::uint16_t delay_ms) noexcept |
| | Set the conn retry count.
|
| |
| bool | is_strict_encryption () const noexcept |
| | Whether the current connection is a TDS 8.0 "strict" one (TLS from the first byte).
|
| |
template<typename Implementation>
struct tdsl::net::network_io_base< Implementation >
Base network type.
- Template Parameters
-
| Implementation | Concrete network implementation type |
template<typename Implementation >
Give up on the response currently being received.
The rest of the response (if any) is still on its way, and nothing tells where it ends: the next request would read it as its own response (e.g. the previous query's result, as a success). The only way to keep the stream in step is to close the connection, so that the next request fails instead and the application reconnects.
- Parameters
-
| [in] | processed | Number of complete TDS messages so far |
- Returns
processed
template<typename Implementation >
Receive one, complete TDS PDU.
TDS packet data can span multiple TDS messages. In such scenarios, each TDS message will have its EOM flag set to false except the last TDS message for the packet data.
The amount of successfully read TDS messages. (for diagnostic purposes only)
The main TDS message receive loop.
The loop is mildly stream-based, meaning it will not wait for a whole TDS packet data to arrive before delivering the data down to parsing, but it waits until we have a complete TDS message before doing so.
The downstream parsing code immediately parses the tokens and fires the callback functions, which allows us to discard the processed data from receive buffer (e.g. a processed ROW token's data)
template<typename Implementation >
| tdsl::detail::e_send_status tdsl::net::network_io_base< Implementation >::do_send_tds_pdu |
( |
tdsl::detail::e_tds_message_type |
mtype | ) |
|
|
inlinenoexcept |
Send contents of the message buffer in one or more TDS PDU's, depending on negotiated packet size.
If any part of the message could not be written into the network buffer (i.e. the message is larger than the buffer), nothing is sent and the message is discarded.
- Parameters
-
| [in] | mtype | The type of the message currently in the network buffer |
If sending a packet fails, the rest of the message is discarded.
- Returns
- e_send_status::success if the message is sent
-
e_send_status::request_too_large if the message was incomplete and discarded (nothing is sent)
-
e_send_status::network_error if sending failed