Supparerk Saikaew

TCP Timeout ?

Discussion created by Supparerk Saikaew on Jul 29, 2006
Latest reply on Aug 27, 2006 by Karl Williams
Hi all
I use NE64_Vend_openTCP.
I initial follow code below.
Code:
void tcp_x_init(void){    WriteToSCI1("Initializing TCP server application. \r\n");    tcp_soch = tcp_getsocket(TCP_TYPE_CLIENT, TCP_TOS_NORMAL, TCP_DEF_TOUT, tcp_control_panel_eventlistener);    if( tcp_soch < 0 )    {            WriteToSCI1("TCP server unable to get socket. Resetting!!!\r\n");            RESET_SYSTEM();    }else{      WriteToSCI1("TCP Get Socket Client Type!!!\r\n");    }    (void)tcp_connect(tcp_soch,0xC0A800C7,2002,TCP_PORT+2);}

 and listener funtion below
Code:
INT32 tcp_control_panel_eventlistener(INT8 cbhandle, UINT8 event, UINT32 par1, UINT32 par2){INT32 i;par2++; // to avoid the compiler warning if( cbhandle != tcp_soch)  /* Not our handle */  return(-1);  switch( event ) {   case TCP_EVENT_CONREQ:   WriteToSCI1("TCP: Connection request arrived!\r\n");   return(1);   break;   case TCP_EVENT_ABORT:   WriteToSCI1("Connection aborting!\r\n");    break;  case TCP_EVENT_CONNECTED:   WriteToSCI1("TCP: TCP connection established!\r\n");   break;  case TCP_EVENT_CLOSE:   WriteToSCI1("TCP Connection closing...!\r\n");   break;  case TCP_EVENT_ACK:   WriteToSCI1("TCP: Data acknowledged!\r\n");    break;     case TCP_EVENT_DATA:   WriteToSCI1("TCP: Data arrived!\r\n");     if(par1 <= 0)         break;       for(i=0;i<par1;i++)          {            TCP_In_Msg[i]=RECEIVE_NETWORK_B();          }           WriteToSCI1("Get data from server : ");           WriteToSCI1(TCP_In_Msg);           WriteToSCI1("\r\n");   send_ack_data();      tcp_send_buffer();   break;     case TCP_EVENT_REGENERATE:      tcp_send_buffer();   break;    default:   return(-1); }}
 
I connected and send/receive data.
After I not send/receive about few minute.
I can't send/receive data again.
How to solv this problem ?
or
What wrong I do.?
 
Thank you for advantage
Mr.X
 

Outcomes