[Top][All Lists]

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

Re: [lwip-devel] Closing connections with rawapi

From: Per Knytt
Subject: Re: [lwip-devel] Closing connections with rawapi
Date: Fri, 2 May 2014 11:42:15 +0200

On Wed, Apr 30, 2014 at 7:23 PM, Sergio R. Caprile <address@hidden> wrote:
(Based on the no response status)
I think you should ask these questions on the users list, you'll have
more attention (and luck) there.

Thanks, but I'm perhaps being too polite :)
I would say that this is definitely a bug but the question is if it's a bug in the documentation
or in the code.

I see three alternatives

1. It is forbidden to call tcp_abort() on a pcb that tcp_connect() has failed on.
    If this is true, rawapi.txt should say so.
    This would make the API more cumbersome to use since if tcp_connect() fails,
    for example because there's no free memory, then tcp_close() can fail for the same
    reason. If we can't call tcp_abort() in that situation the application needs to save state
    to be able to retry tcp_close() later until it succeeds. This is cumbersome in an
    environment that doesn't support blocking operations.

2. It is forbidden to call tcp_connect() on a pcb on which tcp_bind() has been called.
    If this is true, rawapi.txt should say so.
    I guess that this is not entirely unreasonable but a little surprising as the operations
    seems somewhat orthogonal.

3. tcp_abort() should check if the pcb is bound and in that case remove it from tcp_bound_pcbs.
    I would prefer this because it is the least surprising behaviour.

I can submit a patch for either of these three options but I'd like some indication of which is
the preferred solution. Alternatively do nothing if I'm on drugs and this is a non-issue...

Per Knytt

reply via email to

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