lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] TCP client waiting for answer from server


From: Walter Saegesser
Subject: [lwip-users] TCP client waiting for answer from server
Date: Wed, 18 May 2011 07:20:50 +0200

Concerns lwIP v1.3.2.

I have a TCP client in an embedded app and after I send the data I have to wait for an answer.

      ….

         netconn_write ( conn, data, size, NETCONN_NOCOPY );

         TNetBuf xBuf = netconn_recv ( conn );

         if ( xBuf != NULL )

         {

            netbuf_copy   ( xBuf, mRcvBuf, csBufSize );

            netbuf_delete ( xBuf );

         }  

This works so far. But what if the server does not answer? The ‘netconn_recv’ does not seem to have a time-out and the application hangs at this point. I see there is a compiler switch ‘LWIP_SO_RCVTIMEO’, which is disabled by default. Is this the means to accomplish a time-out – and what would be the time – or are there other schemes?

 

There is a problem, though. Besides the TCP client there is also a TCP server that actually should block at  ‘netconn_recv’. Hence I have contradicting requirements. How to overcome this?

 

Thanks in advance.

 

Walter

 

 

_______________________________________________
Walter Saegesser
Dipl.-Ing. (FH)

R&D - Software
Business Unit IMS – Line of Business Solar Inverter
_______________________________________________
Delta Renewable Energy Systems (Switzerland) AG
Burgerfeldstrasse 19, CH-8730 Uznach SG, Switzerland
TEL:       +41 (0)55 246-4140
FAX:      +41 (0)55 246-4116
address@hidden
www.deltaenergysystems.com
_______________________________________________

 

********************************************************************************************************************************
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain
confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
[Delta Energy Systems]
********************************************************************************************************************************

reply via email to

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