Lee kah Joo

The TCP connection will stop after running for some times - NE64.

Discussion created by Lee kah Joo on Jul 14, 2006
Latest reply on Sep 27, 2006 by Ken Krabacher
Hi,
 
   I'm tried to using the NE64 with the Eval board bought from Freescale, to connect to Ethernet. Right now, I'm able to make the connection on the attached file, and also can received and sending TCP packet to and from PC. But there is some things happens is where after I run for sometimes, the devices was received packet from pc and send back the original packet data back to pc, was stop where can't received the packet. When this occurs, I can't make the connection from PC to devices. Below are portion of the code that I've modified from original demo file Freescale, and the file name is udpinterface.c:-
 
 
  case TCP_EVENT_DATA:
   DEBUGOUT("TCP: Data arrived!\r\n");
   /* read data that was received (and
    * probably do something with it
    */
          for(i=0;i<par1;i++)
          {
            TCP_In_Msg[i]=RECEIVE_NETWORK_B();
          }
         
          if(TCP_In_Msg[8]=='9')
          {
           Bit1_NegVal();
          }
         
          //RS232_Puts_Char(TCP_In_Msg);

          
          (void)memcpy(&net_buf[TCP_APP_OFFSET],TCP_In_Msg,sizeof(TCP_In_Msg));
         
          tcp_send(tcp_soch, &net_buf[TCP_APP_OFFSET], NETWORK_TX_BUFFER_SIZE - TCP_APP_OFFSET, sizeof(TCP_In_Msg));
 
   Intially, I was make the connection where when I recived the data from PC through TCP connection, I send out to the Serial Comm port. For this testing, the devices don't have any problem.
 
   Right after, I've tried to make the testing where when I receive the packet from TCP packet, then I send packet data back to the original port. Intially, the devices was able to receive the packet from PC and sending back the packet back to the same port. However, after sometimes, the devices cannot receive the packet.
 
   Did the way I've wrote the code was wrong? Can someone help to fix the problem? Thanks.
 
Message Edited by t.dowe on 2009-10-20 11:09 PM

Outcomes