lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] socket functionality - nonblocking?


From: Piero 74
Subject: Re: [lwip-users] socket functionality - nonblocking?
Date: Tue, 25 Nov 2008 14:43:45 +0100

OH! what's nice news!
Welcome Micael!

I did the first release of my board using nxp arm7 too (lpc2365) and PHY chip from smsc.
In the past i had to decide the same:
(commercial RTOS + commercial TCPIP stack) OR (freeRTOS + LWIP)

i decided for open source choice...
i did some additional work for writing emac driver by myself, sys_arch and ethernetif layer for lwip+freertos, and i spent more time for debug, and... my project became delayed...., but today i think yet that i choosed the better solution, for cost saving, for flexibility, for a great comunity of developers behind freertos and lwip, and now i have more knowledge about TCPIP stack!


i saw in the past posts about socket2.c too.... i don't know who is working on it...
i'm interested on it, because i'd like to work with non-blocking calls (this is the reason because i used select in my tcp manager task)... i want to be sure that every task in my code never block (so... each task "kick" a watchdog manager, and if one is blocked, after few dozen of seconds the board will reset itself)
My dream is a new socket layer for lwip, with the possibility to expand it with custom functions, to bring in socket other data stream (i.e. packets from serial, or from rtos queue...). In this way i could only used select function with all kind of data stream (i like it).

Actually, i have in my code a task which works in this way

while(1)
__wait_on_select (timeout = 50 ms for example)
__if_select_set_from_listener
______accept_connection_and_put_sd_in_select
__if_select_set_from_opensocket
______manage_data_FROM_socket
__wait_on_q (timeout = 0!!!!)
__if_data_from_q
____send_data_TO_socket


but, in this way, i have code which unlock immediately when a packet arrives from socket, but instead can send packets from other tasks polling the queue every 50 ms (or less, if another packet unlock the select before)

i'd like to have something like a select for packet from NET sockets and QUEUE socket!


if you want, we can share our experience, with stack and application code which use bsd socket!

Bye,
Piero


2008/11/25 Micael <address@hidden>
On Tue, November 25, 2008 11:23, Piero 74 wrote:
> 2008/11/25 Kieran Mansley <address@hidden>
>> I'm not sure if you can put a listening socket in the
>> readable set and get notified when a new connection arrives either -

> yes... it's possible... i use it in my code... my task loop using a ..
> It works very well.


Thanks guys!

I understand that there are reasons for not supporting non-blocked io, but
are there any plans or work in progress regarding this? Or doesn't the
current infrastructure lend it self to this easily?
I guess it must have been discussed before. I saw some old posts about a
socket2.c?


I am now at the cross section with the sign saying Left "lwip" Right
"commercial IP stack". :)

If I choose lwip, I guess I will have to either do some implementation
outside the socket layer, or try to help the development of lwip in the
non-blocking way.


Background:
I like the socket api, because of its portability, and almost all my
designs are a bunch of nodes that has open connections to many other,
non-blocking is crucial for me. In this design, I would use lwip with
freertos.org on an NXP arm7tdmi.


 Micael




_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]