lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Non-blocking netconn_write?


From: Dany Thiffeault
Subject: Re: [lwip-users] Non-blocking netconn_write?
Date: Thu, 14 Oct 2010 09:25:40 -0400

Thanks Kieran.

Well... a non-blocking call returning an error would be great for me if there is a connection problem. I could then detect an error when writing the packet and close the connection and shutdown some stuff for safety of people around the device.

I have a device that is acquiring data and streaming everything on Ethernet. So, the majority of the time when streaming, the application is writing data on the Ethernet port. So, if I disconnect the Ethernet cable or another communication problem occurs that "hangs" the thread in the netconn_write function, I cannot detect it.


On Thu, Oct 14, 2010 at 5:09 AM, Kieran Mansley <address@hidden> wrote:
On Wed, 2010-10-13 at 13:43 -0400, Dany Thiffeault wrote:
> Hi,
>
>
> I just found out that "netconn_write" is blocking indefinitely, or
> until the operation completes. This is a problem for me. I'm currently
> testing my system to react correctly when an Ethernet disconnection
> occurs. There are safety features I must implement and one of them is
> to stop everything as soon as I detect a disconnection or a
> communication problem over Ethernet.

The problem you'll have with this is that the return code and error
setting for the netconn_write() (and similarly for sockets API built on
top of netconn) will not be correct.  The code has to wait for the write
to be successful to know that it can return success.  If there was an
error it must report it.


Does do a non-blocking write call instead help you?

Kieran


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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