Cloud COAP-Client TCP Issues

I'm building a COAP client using the Nordic nRF9160DK cloud coap-client example code as my base. I have the UDP version working great. But I'd like to convert to TCP.. I was hoping it would be a simple change to the socket just the addrinfo and socket creation calls, and turning off polling (since it's stream oriented) The first packet appears to send successfully. And the 2nd attempt always fails with a -128 error. I know COAP is more adapted to packet vs stream protocols. But I believe it is designed to work with either. Can you assist with resolving this issue. I will post some screenshots to show the mods I made for TCP.

Related