lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] netconn_write/recv from two different tasks..


From: ThomasJ
Subject: Re: [lwip-users] netconn_write/recv from two different tasks..
Date: Wed, 6 Mar 2013 03:03:55 -0800 (PST)

Hi Sylvian

Just to be clear.

So I do have todo something like with a small receive timeout for the
netconn:

CombinedTXAndRXTask()
{
      // Do connections handlign
      WaitForLink();
      xNetConn = netconn_new(NETCONN_TCP);
      netconn_connect ( xNetConn, &remote_ip, sPortNumber );

      // Receive and transmite
      while(1)
     {
         // RX
        nReceiveErr = netconn_recv(xNetConn, &buf);

        if(nReceiveErr  == ERR_OK)
        {
             // Recevie all buffers here
             // Handle the data --> schedule some data for TX
        }

        // Any TX
        if(AnyTXData())
        {
           netconn_write(xNetConn, byTXBuffer, ETH_RAW_SIZE, NETCONN_COPY);
        }
       vTaskDelay(1); // 
     }// while loop

}

or is it better to use a semaphore around the netconn_recv and
netconn_write, so no write can be done during receiving and no receive
during wrie?

How does you handle it?

Thomas







--
View this message in context: 
http://lwip.100.n7.nabble.com/netconn-write-recv-from-two-different-tasks-tp21198p21200.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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