|
From: | Benjamin Schelte |
Subject: | [lwip-users] 1.4.0.rc1: How to use netconn-API for non-blocking connect? |
Date: | Tue, 19 Oct 2010 10:27:27 +0200 |
Dear all, I am currently integrating the first
release candidate of lwIP 1.4.0 into my project, because I need non-blocking
connect support. As I could not find any example sources or
documentation about this feature I tried it on my own, but so far I could not
succeed. My setup is the following: lwIP v1.4.0.rc1 RTOS Netconn-API The sequence I use to connect to another
device in non-blocking mode is basically the same as previously with one
difference: … psNetconn =
netconn_new(NETCONN_TCP); // New tcp
connection netconn_set_nonblocking(psNetconn,
TRUE); // Don't block! if
(psNetconn != NULL) { eError
= netconn_connect(psNetconn, &sPeerIPAddress, (u16_t)usPort); if
(eError == ERR_OK) { //
Connection established, create request … } else { // Connection error, Reset connection and task status … } else { //
Connection error, Reset connection and task status … } … // Close and
delete the connection if
(psNetconn != NULL) { netconn_close(psNetconn); netconn_delete(psNetconn); psNetconn =
NULL; } … So the only addition in my code is the line
below netconn_new: netconn_set_nonblocking(). However the call to the function “netconn_connect”
always returns ERR_INPROGRESS, but after that nothing more happens. Neither delaying the task and processing
later, nor directly calling “netconn_write” worked (it also
returned ERR_INPROGRESS). Could anyone of the developers please give
me some advice in how to use the non-blocking connect feature, or how it is
supposed to work? I don’t even know, if the mechanism I
use is intended to be solution for the non-blocking connect though. Thanks in advance. Best regards, Benjamin |
[Prev in Thread] | Current Thread | [Next in Thread] |