Benjamin Schelte wrote:
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).
Of course it does, that's what you told it to: nonblocking means the
call is enqueued (your application thread *does* get blocked a
while, but only for the time the lwip-thread needs to enqueue and
send the SYN). If this succeeds, ERR_INPROGRESS is returned.
If you were using a socket (instead of a netconn), select would mark
the socket as writable. Since you are using a netconn, you will have
to implement this on your own: the callback you can pass to
netconn_new_with_callback() will be called with enum netconn_evt ==
NETCONN_EVT_SENDPLUS for your netconn when the connection is
established.
However, this can be quite a pain to implement on your own, so you
might want to use sockets instead if you can live with the extra
copying that API imposes (compared to the netconn API): using
sockets, you can simply connect and then wait (with a timeout) using
select(), just as you would do on any other socket
implementation/OS.
Simon
|