I just found out that "netconn_write" is blocking indefinitely, or until the operation completes. This is a problem for me. I'm currently testing my system to react correctly when an Ethernet disconnection occurs. There are safety features I must implement and one of them is to stop everything as soon as I detect a disconnection or a communication problem over Ethernet.
tcpip_apimsg(struct api_msg *apimsg)
{
struct tcpip_msg msg;
if (mbox != SYS_MBOX_NULL) {
msg.type = TCPIP_MSG_API;
msg.msg.apimsg = apimsg;
sys_mbox_post(mbox, &msg);
sys_arch_sem_wait(apimsg->msg.conn->op_completed, 0); <----------------------- change the 0 to another value.
return ERR_OK;
}
return ERR_VAL;
}