lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LWIP 1.4.1 hangs in tcp_write if data are send out cont


From: tushartp
Subject: Re: [lwip-users] LWIP 1.4.1 hangs in tcp_write if data are send out continously
Date: Thu, 30 Jul 2015 07:17:29 -0700 (MST)

here is my code for the connection bind.

void NETTCPSr(void)
{
  //struct netconn *conn, *newconn;
  err_t err, accept_err;
  struct netbuf *buf;
  u16_t len;    
  //LWIP_UNUSED_ARG(arg);

  /* Create a new connection identifier. */
  pxTCPHandle = netconn_new(NETCONN_TCP);
  pxTCPHandle->pcb.ip->so_options |= SOF_KEEPALIVE;

  if (pxTCPHandle!=NULL)
  {  
    /* Bind connection to well known port number. */
    err = netconn_bind(pxTCPHandle, &(EMAC_if.ip_addr), 14000);
    
    if (err == ERR_OK)
    {
      /* Tell connection to go into listening mode. */
      netconn_listen(pxTCPHandle);
    
      while (1) 
      {
        /* Grab new connection. */
         accept_err = netconn_accept(pxTCPHandle, &pxTCPAccept);
         
        /* Process the new connection. */
        if (accept_err == ERR_OK) 
        {

          while (netconn_recv(pxTCPAccept, &buf) == ERR_OK) 
          {
            do 
            {
              len =  netbuf_len(buf);
              netbuf_copy( buf, &gRxBuf[0], len);
              gRxCounter[ETH_CHANNEL][0] = len;            
              xSemaphoreGive( pMsgSema4Tbl[SEMA4_RXETH_FRAME - 1] );            
  
              //netconn_write(newconn, data, len, NETCONN_COPY);
          
            } 
            while (netbuf_next(buf) >= 0);
          
            netbuf_delete(buf);
          }
        
          /* Close connection and discard connection identifier. */
          netconn_close(pxTCPAccept);
          err=netconn_delete(pxTCPAccept);
          //PROCESS NO DATA RECEIVED        
          TRACE_S("No data received");
          pxTCPAccept=NULL;
          TRACE_SB("TCP Accept Delete return:", err);
          
        }
      }
    }
    else
    {
      netconn_delete(pxTCPHandle);
      pxTCPHandle=NULL;
      TRACE_SB("TCP Handle Delete return:", err);
    }
  }
}



--
View this message in context: 
http://lwip.100.n7.nabble.com/LWIP-1-4-1-hangs-in-tcp-write-if-data-are-send-out-continously-tp24743p24744.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]