This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LWIP Can't Connect to Remote Server

Hi. My code is raw tcp/ip client application. It can connect local server on my computer frequently but it can't connect to remote server "sometimes (about 2/3 ratio) " . Remote server is working properly, I guarantee by connecting my computer with simple socket application. If I try to execute TCP_WRITE function, return error 13 so connection error.

 

I think that My device can't get ACK in timeout or I don't know.

 

How can ı solve this ?

 

My device is LPC1769. I use changed LPCopen TCP/IP Server App to client version by myself.

I add some code block related with changed from lpcopen example. 

I attach my lwipopt.h, that options can execute webserver application with 70kb webpage very fast.

My pcb is blocked at echo_pcb->state = SYN_Sent. It can't get ACK

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void tcp_echoclient_connect(void)
{
struct ip_addr DestIPaddr;
if (echo_pcb != NULL)
{
IP4_ADDR( &DestIPaddr, 192, 168, 1, 39 );
/* connect to destination address/port */
tcp_connect(echo_pcb,&DestIPaddr,7,echo_accept);
}
else
{
/* deallocate the pcb */
memp_free(MEMP_TCP_PCB, echo_pcb);
// DEBUGOUT("\n\r can not create tcp pcb");
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0