[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] where should I call tcp_accepted?
From: |
Valery Ushakov |
Subject: |
Re: [lwip-users] where should I call tcp_accepted? |
Date: |
Fri, 10 May 2013 15:41:47 +0000 (UTC) |
User-agent: |
tin/2.0.1-20111224 ("Achenvoir") (UNIX) (NetBSD/6.1_RC1 (macppc)) |
CHASE CHENG <address@hidden> wrote:
> I added the tcp_accepted in my tcp_accept callback function, but it shows
> fail since pcb->state is already changed to ESTABLISHED.
> I wondered where should I call tcp_accepted?
[...]
> Here is part of the code:
> static err_t
> netio_accept(void *arg, struct tcp_pcb *pcb, err_t err)
> {
> ...
> tcp_accepted(pcb);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> I tried to add tcp_accepted here.
accept callback gets the new, connected, pcb that is in ESTABLISHED
state. tcp_accepted should be called on the listening pcb, that is in
LISTEN state.
-uwe