lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] tcp_connect and tcp_listen problems


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] tcp_connect and tcp_listen problems
Date: Thu, 09 Jan 2003 00:22:13 -0000

On Monday 04 February 2002 10:30, you wrote:
> > The second problem *might* be because the return value of tcp_listen()
> > must be used instead of the value fed into the function. Like this:
> >
> > tcp_pcb *pcb;
> > pcb = tcp_pcb_new();
> > tcp_bind(pcb, ipaddr, port);
> > pcb = tcp_listen(pcb);
> >
> > The reason is that a listening connection uses less memory so it is
> > reallocated when it is put in listening mode.
>
> I'm doing exactly that.

Hmmm. Could you post a few lines of the code and perhaps a packet trace 
showing the connection to the listening port?

> Shouldn't there be a check for the return value of tcp_listen, so the
> original pcb can be freed correctly?

Yes you are right, the original pcb isn't freed automatically so the return 
value should be checked.

Thanks,

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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