[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] netconn_close()
From: |
Frédéric BERNON |
Subject: |
Re: [lwip-users] netconn_close() |
Date: |
Tue, 27 May 2008 23:06:46 +0200 |
Since lwIP API doesn't support concurrent access
on the same netconn/socket, of course.
----- Original Message -----
From: "Frédéric BERNON" <address@hidden>
To: "Mailing list for lwIP users" <address@hidden>
Sent: Tuesday, May 27, 2008 11:03 PM
Subject: Re: [lwip-users] netconn_close()
Since lwIP API doesn't support concurrent access, there is no real advantage
to 'switch' in the tcpip_thread context to change a field which is only used
at "application" side. More, this is in the same spirit that
netconn_recv_bufsize and netconn_err.
----- Original Message -----
From: "Marko Panger" <address@hidden>
To: "Frédéric BERNON" <address@hidden>; "Mailing list for lwIP
users" <address@hidden>
Sent: Tuesday, May 27, 2008 10:29 PM
Subject: Re: [lwip-users] netconn_close()
I'm not aware of lwip implementation details but wouldn't such a way cause
concurent acces problems (tcip and app thread). If I can suggest I would
od it like:
netconn_recv(timeout)
and post this timeout via mailbox to the main tcp thread.
marko
Frédéric BERNON wrote:
We could add something like this in api.h:
#define netconn_recv_timeout(conn) ((conn)->recv_timeout)
----- Original Message ----- From: "Jonathan Larmour"
<address@hidden>
To: "Mailing list for lwIP users" <address@hidden>
Sent: Tuesday, May 27, 2008 9:30 PM
Subject: Re: [lwip-users] netconn_close()
Marko Panger wrote:
Jonathan,
First of all - thanks !
How could I prevent from waiting forever ? I imagine by setting the
conn->recv_timeout. Is there
a api call for this or can I access it directly just before calling
netconn_recv() ?
Unfortunately there isn't a proper API for accessing the receive
timeout,
so for now you can just access the structure member directly in the
netconn, e.g.:
/* Call it a timeout if there is nothing in 60 seconds */
conn->recv_timeout = 60*1000;
buf = netconn_recv(conn);
if (!buf) {
/* It timed out */
...
}
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos
experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223
245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
__________ NOD32 2979 (20080327) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users