Cannot connect to the server over TCP (116 error)

Hi Nordic,

I am coding a program (TCP client) sending an array of bytes to a server over TCP. There is no error during the building process. And, there is also no error with modem initialization. But, I always receive the error 116 when I connect to the TCP server.

For the TCP server, I run a TCP server script in Python to receive the data from the TCP client, I tested the TCP server program by using the Netcat tool, and it works. So the problem comes from the code for nRF9160. 

I consulted a lot of credits on the Devzone, but I cannot find the problem. 

Could you please help me have a look at it? (I am using nRF SDK v2.5.1)

Best,

wu

Code_Nordic.zip