On Fri, Sep 18, 2009 at 11:11 AM, Kieran Mansley
<address@hidden> wrote:
On Fri, 2009-09-18 at 10:48 +0200, Oscar F wrote:
> The function with error is lwip_listen(lSocket[i],10) != 0, the first
> time return 0 but then return -1 for the next socket.
I'm asking some simple questions to help find the cause of your problem
but you keep failing to answer them. I need to know the values of
MEMP_NUM_NETCONN and errno. Please note that errno is not the value
returned by lwip_listen(), it is a global C variable.
Could you for example add the following line of code after the call to
lwip_listen() fails:
printf("MEMP_NUM_NETCONN: %d, errno: %d\n", MEMP_NUM_NETCONN, errno);
and tell us what it prints out?
Your code should now look like this:
//Listen to the 8 socket.Maximum 10 connection for socket
if ( lwip_listen(lSocket[i],10) != 0 )
{
printf("MEMP_NUM_NETCONN: %d, errno: %d\n", MEMP_NUM_NETCONN, errno);
lwip_close(lSocket[i]); //Always enter here
}
(you may need to replace printf with whatever you platform's equivalent
function is)
Thanks