Remote server not access

Hello, I am using quectel EC21 i run example_tcp.c it works fine with local host but if i access remote server by changing its port error(Network is unreachable)appear on screen kindly correct me

You need to set the address and port number of the remote server correctly.

i set address and port correctly but still error happen

the error occur in
connect(sockfd,(struct sockaddr *)(&server_addr),sizeof(struct sockaddr) function the return value of this function is 0 when we use port 3333 and ip but if i use my test server live ip and port this function return -1

HI Sami_Tahir
Can your http address be used to log in directly with a search engine?

no i can’t access my server directly with search engine

Feel sorry. Your search engine can’t connect to your server, how can the module connect? Please make sure your address is correct.
Best wishes