lwip_select never returns value > 0

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

lwip_select never returns value > 0

Nenad Pekez
Hi people,

I am trying to use lwip_select in combination with lwip_recv. I have
done it like this so far:

FD_ZERO(&rfds);
FD_SET(new_sd, &rfds);
tv.tv_sec = 0;
tv.tv_usec = 200000;

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)
{
     lwip_recv()

}

No matter what, timeout always exceeds. Am I doing anything wrong?
Should I include some lwip option in order to use lwip_select()?
I am using lwip v1.4.1.

Regards,
Nenad


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Ajay Bhargav (SiWi)

Hi Nenad,

 

Did you check errno?

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 5:51 PM
To: [hidden email]
Subject: [lwip-users] lwip_select never returns value > 0

 

Hi people,

 

I am trying to use lwip_select in combination with lwip_recv. I have

done it like this so far:

 

FD_ZERO(&rfds);

FD_SET(new_sd, &rfds);

tv.tv_sec = 0;

tv.tv_usec = 200000;

 

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)

{

     lwip_recv()

 

}

 

No matter what, timeout always exceeds. Am I doing anything wrong?

Should I include some lwip option in order to use lwip_select()?

I am using lwip v1.4.1.

 

Regards,

Nenad

 

 

_______________________________________________

lwip-users mailing list

[hidden email]

https://lists.nongnu.org/mailman/listinfo/lwip-users

 


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Nenad Pekez

Hi Ajay,

I have just checked it. Since timeout always expires, return value of lwip_select() is always 0. Therefore no errno is set.

On 14.3.2017 13:40, [hidden email] wrote:

Hi Nenad,

 

Did you check errno?

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 5:51 PM
To: [hidden email]
Subject: [lwip-users] lwip_select never returns value > 0

 

Hi people,

 

I am trying to use lwip_select in combination with lwip_recv. I have

done it like this so far:

 

FD_ZERO(&rfds);

FD_SET(new_sd, &rfds);

tv.tv_sec = 0;

tv.tv_usec = 200000;

 

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)

{

     lwip_recv()

 

}

 

No matter what, timeout always exceeds. Am I doing anything wrong?

Should I include some lwip option in order to use lwip_select()?

I am using lwip v1.4.1.

 

Regards,

Nenad

 

 

_______________________________________________

lwip-users mailing list

[hidden email]

https://lists.nongnu.org/mailman/listinfo/lwip-users

 



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Ajay Bhargav (SiWi)

If you do not use select call, Are you able to receive anything? It may be possible that since there is no data available select will eventually timeout.

 

Regards,

Ajay bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 6:17 PM
To: [hidden email]
Subject: Re: [lwip-users] lwip_select never returns value > 0

 

Hi Ajay,

I have just checked it. Since timeout always expires, return value of lwip_select() is always 0. Therefore no errno is set.

On 14.3.2017 13:40, [hidden email] wrote:

Hi Nenad,

 

Did you check errno?

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 5:51 PM
To: [hidden email]
Subject: [lwip-users] lwip_select never returns value > 0

 

Hi people,

 

I am trying to use lwip_select in combination with lwip_recv. I have

done it like this so far:

 

FD_ZERO(&rfds);

FD_SET(new_sd, &rfds);

tv.tv_sec = 0;

tv.tv_usec = 200000;

 

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)

{

     lwip_recv()

 

}

 

No matter what, timeout always exceeds. Am I doing anything wrong?

Should I include some lwip option in order to use lwip_select()?

I am using lwip v1.4.1.

 

Regards,

Nenad

 

 

_______________________________________________

lwip-users mailing list

[hidden email]

https://lists.nongnu.org/mailman/listinfo/lwip-users

 




_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 

 


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Nenad Pekez

So far I have used SO_RCVTIMEO socket functionality for timeout, and I have always received data. Never had problems with it. However, I would like to switch to select() for timeouts, because of some various reasons.


On 14.3.2017 13:50, [hidden email] wrote:

If you do not use select call, Are you able to receive anything? It may be possible that since there is no data available select will eventually timeout.

 

Regards,

Ajay bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 6:17 PM
To: [hidden email]
Subject: Re: [lwip-users] lwip_select never returns value > 0

 

Hi Ajay,

I have just checked it. Since timeout always expires, return value of lwip_select() is always 0. Therefore no errno is set.

On 14.3.2017 13:40, [hidden email] wrote:

Hi Nenad,

 

Did you check errno?

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 5:51 PM
To: [hidden email]
Subject: [lwip-users] lwip_select never returns value > 0

 

Hi people,

 

I am trying to use lwip_select in combination with lwip_recv. I have

done it like this so far:

 

FD_ZERO(&rfds);

FD_SET(new_sd, &rfds);

tv.tv_sec = 0;

tv.tv_usec = 200000;

 

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)

{

     lwip_recv()

 

}

 

No matter what, timeout always exceeds. Am I doing anything wrong?

Should I include some lwip option in order to use lwip_select()?

I am using lwip v1.4.1.

 

Regards,

Nenad

 

 

_______________________________________________

lwip-users mailing list

[hidden email]

https://lists.nongnu.org/mailman/listinfo/lwip-users

 




_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 

 



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Noam weissman
In reply to this post by Nenad Pekez
Hi,

Try using:

tv.tv_sec = 1;
tv.tv_usec = 0;

It works for me

BR,
Noam.

-----Original Message-----
From: lwip-users [mailto:lwip-users-bounces+noam=[hidden email]] On Behalf Of pekez
Sent: Tuesday, March 14, 2017 2:19 PM
To: Mailing list for lwIP users
Subject: [lwip-users] lwip_select never returns value > 0

Hi people,

I am trying to use lwip_select in combination with lwip_recv. I have done it like this so far:

FD_ZERO(&rfds);
FD_SET(new_sd, &rfds);
tv.tv_sec = 0;
tv.tv_usec = 200000;

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0) {
     lwip_recv()

}

No matter what, timeout always exceeds. Am I doing anything wrong?
Should I include some lwip option in order to use lwip_select()?
I am using lwip v1.4.1.

Regards,
Nenad


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_select never returns value > 0

Ajay Bhargav (SiWi)
In reply to this post by Nenad Pekez

How much timeout have you set in your socket option? If receive timeout works then select should work too (I have not tested it myself though). One last thing to check is, try to increase timeout value and see if you get some data or not.

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 6:24 PM
To: [hidden email]
Subject: Re: [lwip-users] lwip_select never returns value > 0

 

So far I have used SO_RCVTIMEO socket functionality for timeout, and I have always received data. Never had problems with it. However, I would like to switch to select() for timeouts, because of some various reasons.

 

On 14.3.2017 13:50, [hidden email] wrote:

If you do not use select call, Are you able to receive anything? It may be possible that since there is no data available select will eventually timeout.

 

Regards,

Ajay bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 6:17 PM
To: [hidden email]
Subject: Re: [lwip-users] lwip_select never returns value > 0

 

Hi Ajay,

I have just checked it. Since timeout always expires, return value of lwip_select() is always 0. Therefore no errno is set.

On 14.3.2017 13:40, [hidden email] wrote:

Hi Nenad,

 

Did you check errno?

 

Regards,

Ajay Bhargav

 

 

From: [hidden email]
Sent: Tuesday, March 14, 2017 5:51 PM
To: [hidden email]
Subject: [lwip-users] lwip_select never returns value > 0

 

Hi people,

 

I am trying to use lwip_select in combination with lwip_recv. I have

done it like this so far:

 

FD_ZERO(&rfds);

FD_SET(new_sd, &rfds);

tv.tv_sec = 0;

tv.tv_usec = 200000;

 

if (lwip_select(new_sd + 1, &rfds, NULL, NULL, &tv) > 0)

{

     lwip_recv()

 

}

 

No matter what, timeout always exceeds. Am I doing anything wrong?

Should I include some lwip option in order to use lwip_select()?

I am using lwip v1.4.1.

 

Regards,

Nenad

 

 

_______________________________________________

lwip-users mailing list

[hidden email]

https://lists.nongnu.org/mailman/listinfo/lwip-users

 





_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 

 




_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 

 


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users