Persistent TCP Connection?

Hi All,
Im wanting to create a edge driver that connects to a device usind a persistent TCP connection and send commands and receives messages as text.

Has anyone got an example of a driver that uses a persistent TCP connection?

I tried once a while ago and it didn’t work because the connection hangs waiting for some unknown size data.