How do you know when your data is received completely?
This is why you should prefix every Message, you send from the PC with the Length of the following Message/Data. If youre sending it using B4j, you can use the built-in prefix mode by calling .Initialzeprefix . Otherwise you should create your own. just use the first 4 bytes for the length.
When receiving a new message, you check the first 4 bytes. Then you save it to a variable, then you check whether the received data length equals the length you saved before. If so, you're done. if not, wait until its done.
Terminated, as you can tell by the name, is not called when the receiving is done and i never saw the DataCompleted Event.