lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] lwip and multi threading


From: markus . forrer
Subject: [lwip-users] lwip and multi threading
Date: Tue, 21 Jan 2014 12:36:06 +0100 (CET)

I implemented a HTTP server with lwip 1.4.1. Because I have to transmit large 
files (HTTP POST) and to update the download progress in a browser at the same 
time I need several connections. Sometimes it works fine, sometimes I’ll get 
the error: “netconn_accept: invalid recvmbox”.

My code looks like (common resources are locked by semaphore):


void ListenerThread(void)
{
  :
  while (netconn_accept(listenerConnection, &newConnection) == ERR_OK)
  {
    CreateXYThread(newConnection);
  }
}


void XYThread(void *pData)
{
  struct netconn *connection = (struct netconn *)pData;
  :
  netconn_recv(connection, &receiveBuffer);
  :
  // HTTP round trip
  :
  DeleteXYThread();
}


Is netconn api thread save or do I have to use raw api instead of netconn for 
multiple connections?

Thank you very much for your help!

Best regards
Markus



reply via email to

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