I’m working with DC9.01. My application uses a couple of tcp_sockets, and they are used eventually in different costates.
Everything seems to work fine… but then, from time to time, it happens that a socket is open, and then never achieves the “established” status, so there becomes a neverending loop:
(…)
tcp_open(&(worklist_socket[User]),0,inet_addr(cfg_serv_ip_addres),atoi(cfg_ip_port),NULL);
while(!sock_established(&(worklist_socket[User])) && sock_bytesready(&(worklist_socket[User]))==-1)
{
// only_local is 0
if((!tcp_tick(&(worklist_socket[User])))||only_local)
{
Connected=0;
break;
}
else
{
Connected=1;
yield;
// the loop remains looping and looping through this branch…
}
}
Can you guess what can happen, so that socket was open but never reaches the condition of “established”?