public class FileSender extends Object
FileReceiver
.
Protocol is to send a file-create
followed by 1 or more file-chunk
messages that are all
linked via the correlation id. Messages are encoded in ByteOrder.LITTLE_ENDIAN
.
The chunk size if best determined by Publication.maxPayloadLength()
minus header for the chunk.
file-create
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version | +---------------------------------------------------------------+ | Message Type = 1 | +---------------------------------------------------------------+ | Correlation ID | | | +---------------------------------------------------------------+ | File Length | | | +---------------------------------------------------------------+ | File Name Length | +---------------------------------------------------------------+ | File Name ... ... | +---------------------------------------------------------------+file-chunk
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version | +---------------------------------------------------------------+ | Message Type = 2 | +---------------------------------------------------------------+ | Correlation ID | | | +---------------------------------------------------------------+ | Chunk Offset | | | +---------------------------------------------------------------+ | Chunk Length | | | +---------------------------------------------------------------+ | Chunk Payload ... ... | +---------------------------------------------------------------+
Constructor and Description |
---|
FileSender() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Main method for launching the process.
|
public static void main(String[] args) throws InterruptedException
args
- passed to the process.InterruptedException
- if the thread is interrupted when sleeping.Copyright © 2014-2022 Real Logic Limited. All Rights Reserved.