Recording Communication Content
When implementing communication features, there are almost always times when you want to reproduce the situation later.
This is especially essential when the environment of the communication partner is difficult to prepare.
Therefore, I implemented a feature in ObjectDeliverer to save communication content to a log file and play it back.
Sample
Here is a sample using the save and playback features.
The communication content here is a captured bitmap of 800px x 450px 32bit ARGB, so 1,440,000 bytes = (800 x 450 x 4) of data are sent and received every 60fps (=16.66ms).
The data flow repeats as follows: [WPF App] → (Shared Memory) → [UE4 App] → (Log File)
Since the video capture for recording was also running in parallel, it was quite choppy, but it managed to work somehow.
ObjectDelivererのログ保存機能と再生機能のサンプル。
— ayuma (@ayuma_x) February 6, 2019
WPFのアプリの映像を共有メモリ経由で表示しながらログファイルに保存して、後から読み込んでもう一度再現してます。
ちょっと重くてカクついてますが。#UE4 #UE4Study #ObjectDeliverer pic.twitter.com/fbdxyxK9nO
Log File Saving Feature
Set and use ProtocolLogWriter
during ObjectDeliverer’s Start.
Calling Send
writes data to the log file.
Each write to the log file also records the elapsed time from the start in millisecond order.

Log File Playback Feature
Set and use ProtocolLogReader
during ObjectDeliverer’s Start.

Calling Start triggers the ReceiveData
event each time the time recorded in the log file elapses.
Therefore, you can process the received data just like in normal communication with a partner.

Summary
By implementing the log file saving and playback features, I was able to cover a significant portion of the functionality I initially wanted to implement in ObjectDeliverer.
All that remains is to implement Object sending/receiving using serialization with MessagePack, and then it will be a good stopping point.