Hi, You should receive the NULL because in api_msg.c, the err_tcp function is called. You should add a printf to check that. If it's not the case, the problem could be your sys_arch.c implementation... Good luck... ==================================== Frédéric BERNON HYMATOM SA Chef de projet informatique Microsoft Certified Professional Tél. : +33 (0)4-67-87-61-10 Fax. : +33 (0)4-67-70-85-44 Email : [EMAIL PROTECTED] Web Site : http://www.hymatom.fr <http://www.hymatom.fr/> ==================================== P Avant d'imprimer, penser à l'environnement
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de [EMAIL
PROTECTED]
Envoyé : lundi 28 mai 2007 17:06
À : [email protected]
Objet : [lwip-users] Problem with lwip_select under Nucleus
Hello again.
I had a look at the points you mentioned to me:
First of all, I have checked that MSG_DONTWAIT in the flags to the recv
operation, and O_NONBLOCK to the socket options are both set to zero. In fact,
both flag fields are completely zero. So that the socket should be blocking, am
I right?
>Take a look at the lwip_recvfrom() function. Can you check the
following when you call it by adding some extra debugging:
> - that sock->lastdata is NULL.
OK, it is null
> - that buf returned by netconn_recv() is NULL.
It is null too.
>If that is the case, take a look at netconn_recv(). This can return
NULL for all sorts of reasons. Add debugging (e.g. a printf) to each one and
>see which case is failing.
Next, I specify the failing case, which shows the reason for which the
function returns NULL.
struct netbuf *
netconn_recv(struct netconn *conn)
{
...
if (conn == NULL) {
return NULL;
}
if (conn->recvmbox == SYS_MBOX_NULL) {
conn->err = ERR_CONN;
return NULL;
}
if (conn->err != ERR_OK) {
return NULL;
}
if (conn->type == NETCONN_TCP) {
if (conn->pcb.tcp->state == LISTEN) {
conn->err = ERR_CONN;
return NULL;
}
buf = memp_malloc(MEMP_NETBUF);
if (buf == NULL) {
conn->err = ERR_MEM;
return NULL;
}
sys_mbox_fetch(conn->recvmbox, (void **)&p);
if (p != NULL)
{
len = p->tot_len;
conn->recv_avail -= len;
}
else
<<<<<<<<<<<<<<<<<<<<<<<<< IT GETS INTO THIS ELSE
len = 0;
printf("\n Entra en el ELSE, Chkp1\n");
/* Register event with callback */
if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
printf("\n Entra en el Callback, Chkp2\n");
/* If we are closed, we indicate that we no longer wish to receive
data by setting conn->recvmbox to SYS_MBOX_NULL. */
if (p == NULL) {
<<<<<<<<<<<<<<<<<<<<<<<<< IT GOES INTO THIS IF (p==NULL)
memp_free(MEMP_NETBUF, buf);
sys_mbox_free(conn->recvmbox);
conn->recvmbox = SYS_MBOX_NULL;
return NULL;
<<<<<<<<<<<<<<<<<<<<<<<<< RETURNS NULL
}
....
....
....
return buf;
}
The problem seems to be that it is receiving that null p. I would thank
any advice.
Thank you very much for your help and for using your time for this
purpose.
Best regards,
Borja.
<<image001.jpg>>
<<image002.jpg>>
BEGIN:VCARD VERSION:2.1 N:BERNON;Frédéric;;M. FN:Frédéric BERNON ORG:HYMATOM SA;Recherche et Développement TITLE:Chef de projet informatique TEL;WORK;VOICE:04-67-87-61-10 TEL;WORK;FAX:04-67-70-85-44 ADR;WORK;ENCODING=QUOTED-PRINTABLE:;23;Zone Industrielle=0D=0A175 rue de Massacan;VENDARGUES;;34740;FRANCE; LABEL;WORK;ENCODING=QUOTED-PRINTABLE:23=0D=0AZone Industrielle=0D=0A175 rue de Massacan=0D=0AVENDARGUES 34740=0D= =0AFrance URL;WORK:http://www.hymatom.fr ROLE:Chef de projet informatique EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20020404T083210Z END:VCARD
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
