wrench::FileTransferThread
-
class FileTransferThread : public wrench::Service
A helper class that implements the concept of a communication thread that performs a file transfer.
Public Functions
Constructor.
- Parameters
hostname – host on which to run
parent – the parent storage service
file – the file corresponding to the connection
num_bytes_to_transfer – number of bytes to transfer
src_mailbox – the a source mailbox to receive data from
dst_location – a location to write data to
answer_mailbox_if_read – the mailbox to send an answer to in case this was a file read (”” if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_write – the mailbox to send an answer to in case this was a file write (”” if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_copy – the mailbox to send an answer to in case this was a file copy (”” if none). This will simply be reported to the parent service, who may use it as needed
buffer_size – the buffer size to use
Constructor.
- Parameters
hostname – host on which to run
parent – the parent storage service
file – the file corresponding to the connection
num_bytes_to_transfer – number of bytes to transfer
src_location – a location to read data from
dst_mailbox – a mailbox to send data to
answer_mailbox_if_read – the mailbox to send an answer to in case this was a file read (”” if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_write – the mailbox to send an answer to in case this was a file write (”” if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_copy – the mailbox to send an answer to in case this was a file copy (”” if none). This will simply be reported to the parent service, who may use it as needed
buffer_size – the buffer size to use
Constructor.
- Parameters
hostname – host on which to run
parent – the parent storage service
file – the file corresponding to the connection
num_bytes_to_transfer – number of bytes to transfer
src_location – a location to read data from
dst_location – a location to send data to
answer_mailbox_if_read – the mailbox to send an answer to in case this was a file read (nullptr if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_write – the mailbox to send an answer to in case this was a file write (nullptr if none). This will simply be reported to the parent service, who may use it as needed
answer_mailbox_if_copy – the mailbox to send an answer to in case this was a file copy (nullptr if none). This will simply be reported to the parent service, who may use it as needed
buffer_size – the buffer size to use
-
virtual void cleanup(bool has_returned_from_main, int return_value) override
Cleanup method.
-
virtual int main() override
Main method.
- Returns
0 on success, non-zero otherwise