lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] idle connection timeout


From: mobin.seven
Subject: Re: [lwip-users] idle connection timeout
Date: Mon, 15 Sep 2014 23:39:33 -0700 (MST)

Simon Goldschmidt-2 wrote
> mobin.seven wrote:
>> I want to close idle connections on server side with 15s timeout.
>> Is  SO_RCVTIMEO what I need?
>> I use this line:
>> int timeout = 15000;
>> lwip_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout,
>> sizeof(timeout));
> 
> Where did you get that line from? lwIP tries to implement the standard. 
> And the standard says (google for "opengroup so_rcvtimeo" and you find 
> it) that it "accepts a timeval structure" for SO_RCVTIMEO. I guess you 
> have been using winsock before (they use a DWORD pointer with 
> miliseconds)? Winsock is in most cases not a good example when trying to 
> write portable code :-)
> 
> 
> Simon

Thanks.
yes I'm coming from winsock :D I edited my code:

     struct timeval tv;
   
     tv.tv_sec= 0;
     tv.tv_usec= 500;

     lwip_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct
timeval));// returns 92

I'm still getting ENOPROTOOPT !
Is it wrong yet?
Thank you



--
View this message in context: 
http://lwip.100.n7.nabble.com/idle-connection-timeout-tp23252p23261.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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