xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
transmit_file_options.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include "../../ustring.h"
7 
9 #undef disconnect
10 
13 namespace xtd {
15  namespace net {
17  namespace sockets {
29  enum class transmit_file_options {
33  disconnect = 0b1,
35  reuse_socket = 0b10,
37  write_behind = 0b100,
39  use_system_thread = 0b1000,
41  use_kernel_apc = 0b100000,
42  };
43 
45  inline transmit_file_options& operator^=(transmit_file_options& lhs, transmit_file_options rhs) {lhs = static_cast<transmit_file_options>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
46  inline transmit_file_options& operator&=(transmit_file_options& lhs, transmit_file_options rhs) {lhs = static_cast<transmit_file_options>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
47  inline transmit_file_options& operator|=(transmit_file_options& lhs, transmit_file_options rhs) {lhs = static_cast<transmit_file_options>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
48  inline transmit_file_options& operator+=(transmit_file_options& lhs, transmit_file_options rhs) {lhs = static_cast<transmit_file_options>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
49  inline transmit_file_options& operator-=(transmit_file_options& lhs, transmit_file_options rhs) {lhs = static_cast<transmit_file_options>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
50  inline transmit_file_options operator^(transmit_file_options lhs, transmit_file_options rhs) {return static_cast<transmit_file_options>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
51  inline transmit_file_options operator&(transmit_file_options lhs, transmit_file_options rhs) {return static_cast<transmit_file_options>(static_cast<int>(lhs) & static_cast<int>(rhs));}
52  inline transmit_file_options operator|(transmit_file_options lhs, transmit_file_options rhs) {return static_cast<transmit_file_options>(static_cast<int>(lhs) | static_cast<int>(rhs));}
53  inline transmit_file_options operator+(transmit_file_options lhs, transmit_file_options rhs) {return static_cast<transmit_file_options>(static_cast<int>(lhs) + static_cast<int>(rhs));}
54  inline transmit_file_options operator-(transmit_file_options lhs, transmit_file_options rhs) {return static_cast<transmit_file_options>(static_cast<int>(lhs) - static_cast<int>(rhs));}
55  inline transmit_file_options operator~(transmit_file_options lhs) {return static_cast<transmit_file_options>(~static_cast<int>(lhs));}
56  inline std::ostream& operator<<(std::ostream& os, transmit_file_options value) {return os << to_string(value, {{transmit_file_options::use_default_worker_thread, "use_default_worker_thread"}, {transmit_file_options::disconnect, "disconnect"}, {transmit_file_options::reuse_socket, "reuse_socket"}, {transmit_file_options::write_behind, "write_behind"}, {transmit_file_options::use_system_thread, "use_system_thread"}, {transmit_file_options::use_kernel_apc, "use_kernel_apc"}});}
57  inline std::wostream& operator<<(std::wostream& os, transmit_file_options value) {return os << to_string(value, {{transmit_file_options::use_default_worker_thread, L"use_default_worker_thread"}, {transmit_file_options::disconnect, L"disconnect"}, {transmit_file_options::reuse_socket, L"reuse_socket"}, {transmit_file_options::write_behind, L"write_behind"}, {transmit_file_options::use_system_thread, L"use_system_thread"}, {transmit_file_options::use_kernel_apc, L"use_kernel_apc"}});}
59  }
60  }
61 }
Start a transport-level disconnect after all the file data has been queued for transmission. When used with xtd::net::sockets::transmit_file_options::reuse_socket, these flags return the socket to a disconnected, reusable state after the file has been transmitted.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Use kernel asynchronous procedure calls (APCs) instead of worker threads to process long file transfe...
transmit_file_options
The TransmitFileOptions enumeration defines values used in file transfer requests.
Definition: transmit_file_options.h:29
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
Use system threads to process long file transfer requests.
Complete the file transfer request immediately, without pending. If this flag is specified and the fi...
Use the default thread to process long file transfer requests.
The socket handle may be reused when the request completes. This flag is valid only if xtd::net::sock...