lwIP Wiki
Advertisement

Not available in v1.3.2 and earlier.

netconn_set_recvtimeout[]

void netconn_set_recvtimeout ( struct netconn * aNetConn, int aTimeout );

Set a timeout value in ms for netconn_recv ()

  • in aNetconn : previously allocated netconn struct (e.g. netconn_new)
  • in aTimeout : time in ms

This is just a macro expanding to ( ( aNetConn )->recv_timeout = ( aTimeout ) ). For this macro to have any effect, you must (in lwIPopts.h)

#define LWIP_SO_RCVTIMEO                  1              // default is 0

Note that just activating LWIP_SO_RCVTIMEO does not automatically provide a timeout. The time is set to 0 by default. You have to use netconn_set_recvtimeout.


netconn_get_recvtimeout

int netconn_get_recvtimeout ( struct netconn * aNetConn );

Get the timeout value in ms associated to a netconn structure.

  • in aNetconn : previously allocated netconn struct (e.g. netconn_new)
  • return : timeout value in ms

This too is just a macro expanding to ( ( aNetConn )->recv_timeout ) and the above mentioned define must also be activated.


Hint

To set a timeout in v1.3.2 or earlier you have to access the timeout parameter in the struct netconn manually.

conn->recv_timeout = 10000; // for 10s


(last changed: 24.05.2011)

Advertisement