Flush/Data on Demand

Streaming sockets can’t be flushed/closed independently of direction of data flow (in/out). Datagram sockets could be, but it would be kind of cumbersome to do that.

If you are planning on putting this in a datacenter somewhere, then I’d switch to HTTP rather than raw socket usage. This will give you the most options for building out a scalable backend service. Epic does exactly this for a bunch of our own services (Epic account, marketplace catalog, etc.)