Networking between Indy10 and System.Net.Sockets

Me and my partner working on a project where my partner is developing in Pascal and using Indy10 socket for networking and I'm developing under C# in an UWP project. Therefore for networking I have to use streamsocket namespace.

The problem is, that my partner uses ReadStream method with -1 and false parameters, that mean that the length of the receiving stream is indetermined. Therefore, I have to send a length prefix calculated (in this case I use BitConverter.GetBytes method) from the data in my stream (for example using DataWriter class) continued with the data itself.
But Indy10 socket don't receives nothing. It looks like it stucks on waiting for the packet or I don't know.

Does anybody hit that problem? Please help, we've been looking after the solution for about two weeks. I had read all the similar questions here in StackOverflow, a blog about the use of framing, delimitering. Searched for solution in Indy Socket source code itself.
Please help!

UPDATE 1

C# code. In this case I am sending from a WPF application. The logic, how streams are used in UWP are almost the same, just using StreamSocket and DataWriter.

Pascal code on the server side, waiting for stream. It is crucial to receive in this way, because the software's other modules (also written in Pascal using Indy10) communicating with the server in this way.

Finally, here is the solution. We worked on that all day. We used Synapse socket as a reference. In the end here is the code under UWP, and we tested it in other desktop projects (WPF, Winforms) too (with TcpClient and NetworkStream).
BitConverter and prefixing the hole stream with a number didn't worked, because Indy waits for the length in binary format, therefore the byte array have to contain values representing the binary length. I hope it will help others having similar problem!