[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE : [lwip-users] Problem with lwip_select under Nucleus
From: |
Frédéric BERNON |
Subject: |
RE : [lwip-users] Problem with lwip_select under Nucleus |
Date: |
Mon, 28 May 2007 17:50:27 +0200 |
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 : address@hiddenr
Web Site : http://www.hymatom.fr
====================================
P
Avant
d'imprimer, penser à l'environnement
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.
Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf