lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Newbie question (tcp_pcb* allocation)


From: David Aldrich
Subject: [lwip-users] Newbie question (tcp_pcb* allocation)
Date: Thu, 26 Feb 2004 16:05:52 -0000

Hi

At the risk of hogging the mailing list, I would like to ask another
question.  It relates to the allocation of the connection identifier
during initialisation.  Here is my initialisation sequence and the value
of the connection id after each action:

struct tcp_pcb* my_pcb;

my_pcb = tcp_new();
[my_pcb = ValueA]

tcp_bind(my_pcb);

my_pcb = tcp_listen(my_pcb);
[my_pcb = ValueB]

tcp_accept(my_pcb);

Now I understand that tcp_listen reallocates the connection id, so all
is fine so far,  However, when the connection is established, my accept
callback gets called with pcb = ValueA.  Surely, pcb should have ValueB
at this point.  Can anyone explain this please?

I want to keep my connection identifier as a static variable that my
functions can access to pass to tcp_write etc.  However, presently its
not clear to me how to assign this variable: use the value returned by
tcp_new() or tcp_listen()?

Thank you

David




reply via email to

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