Public Member Functions | |
| TransferThread (span< ClientContext > client_transfers, span< ServerContext > server_transfers, ByteSpan chunk_buffer, ByteSpan encode_buffer) | |
| void | SetServerCompletionCallback (pw::Function< void(uint32_t, pw::Status)> &&cb) |
| void | NotifyServerCompletion (uint32_t session_id, Status status) |
| void | StartClientTransfer (TransferType type, ProtocolVersion version, uint32_t resource_id, uint32_t handle_id, stream::Stream *stream, const TransferParameters &max_parameters, Function< void(Status)> &&on_completion, chrono::SystemClock::duration timeout, chrono::SystemClock::duration initial_timeout, uint8_t max_retries, uint32_t max_lifetime_retries, uint32_t initial_offset=0) |
| void | StartServerTransfer (TransferType type, ProtocolVersion version, uint32_t session_id, uint32_t resource_id, ConstByteSpan raw_chunk, const TransferParameters &max_parameters, chrono::SystemClock::duration timeout, uint8_t max_retries, uint32_t max_lifetime_retries, uint32_t initial_offset=0) |
| void | ProcessClientChunk (ConstByteSpan chunk) |
| void | ProcessServerChunk (ConstByteSpan chunk) |
| void | SendServerStatus (TransferType type, uint32_t session_id, ProtocolVersion version, Status status) |
| void | CancelClientTransfer (uint32_t handle_id) |
| void | EndClientTransfer (uint32_t session_id, Status status, bool send_status_chunk=false) |
| void | EndServerTransfer (uint32_t session_id, Status status, bool send_status_chunk=false) |
| void | SetClientReadStream (rpc::RawClientReaderWriter &read_stream, Client *client, Function< void(ConstByteSpan)> &&on_next, internal::SetStreamBehavior behavior) |
| void | CloseClientReadStream (Client *client) |
| void | SetClientWriteStream (rpc::RawClientReaderWriter &write_stream, Client *client, Function< void(ConstByteSpan)> &&on_next, internal::SetStreamBehavior behavior) |
| void | CloseClientWriteStream (Client *client) |
| void | SetServerReadStream (rpc::RawServerReaderWriter &read_stream, Function< void(ConstByteSpan)> &&on_next) |
| void | SetServerWriteStream (rpc::RawServerReaderWriter &write_stream, Function< void(ConstByteSpan)> &&on_next) |
| bool | AddTransferHandler (Handler &handler) |
| bool | RemoveTransferHandler (Handler &handler) |
| size_t | max_chunk_size () const |
| void | Terminate () |
| void | WaitUntilEventIsProcessed () |
| void | SimulateClientTimeout (uint32_t session_id) |
| void | SimulateServerTimeout (uint32_t session_id) |
| void | EnqueueResourceEvent (uint32_t resource_id, ResourceStatusCallback &&callback) |
Friends | |
| class | transfer::Client |
| class | Context |
| void pw::transfer::internal::TransferThread::SetClientReadStream | ( | rpc::RawClientReaderWriter & | read_stream, |
| Client * | client, | ||
| Function< void(ConstByteSpan)> && | on_next, | ||
| internal::SetStreamBehavior | behavior | ||
| ) |
Updates the transfer thread's client read stream.
The provided stream should not have an on_next function set. Instead, on_next is passed separately to ensure that it is only set when the new stream becomes the transfer thread's primary stream.
If the thread has an existing active client read stream, closes it and terminates any transfers running on it.
| void pw::transfer::internal::TransferThread::SetClientWriteStream | ( | rpc::RawClientReaderWriter & | write_stream, |
| Client * | client, | ||
| Function< void(ConstByteSpan)> && | on_next, | ||
| internal::SetStreamBehavior | behavior | ||
| ) |
Updates the transfer thread's client write stream.
The provided stream should not have an on_next function set. Instead, on_next is passed separately to ensure that it is only set when the new stream becomes the transfer thread's primary stream.
If the thread has an existing active client write stream, closes it and terminates any transfers running on it.
|
inline |
Set callback to be invoked when a server-side transfer completes or fails.
| void pw::transfer::internal::TransferThread::SetServerReadStream | ( | rpc::RawServerReaderWriter & | read_stream, |
| Function< void(ConstByteSpan)> && | on_next | ||
| ) |
Updates the transfer thread's server read stream.
The provided stream should not have an on_next function set. Instead, on_next is passed separately to ensure that it is only set when the new stream becomes the transfer thread's primary stream.
If the thread has an existing active server read stream, closes it and terminates any transfers running on it.
| void pw::transfer::internal::TransferThread::SetServerWriteStream | ( | rpc::RawServerReaderWriter & | write_stream, |
| Function< void(ConstByteSpan)> && | on_next | ||
| ) |
Updates the transfer thread's server write stream.
The provided stream should not have an on_next function set. Instead, on_next is passed separately to ensure that it is only set when the new stream becomes the transfer thread's primary stream.
If the thread has an existing active server write stream, closes it and terminates any transfers running on it.