Socket fs
Boris Mulder
boris.mulder at ...434...
Mon Mar 13 15:48:54 CET 2017
Hi all,
I've managed to port one of our existing network applications to use the
socket fs from 17.02 now, starting from the echo_udp scenario and got it
working. It looks a lot better now.
Following this, we would like to share our findings about the socket fs
so far:
1. In the release notes you describe the support for async file I/O.
However, it seems that while asynchronous I/O works now, synchronous I/O
is no longer possible. When I remove the select() call in the echo
scenario, the call to recvfrom() will fail saying the socket is not
connected (even though it is an UDP socket and should not have the
notion of connections at all).
Of course this means it is not posix compatible; the intended behaviour
is to block until data becomes available.
2. Currently there are two ways an application can use tcp/ip sockets
from the lxip stack: By using libc sockets, and by directly opening a
file system session and writing to the right socket files. For any new
Genode application that does not already depend on libc, the first way
means you unnecessarily add the entirety of libc to your component. So
the second way seems preferred.
However, when programming an application using a file system session
directly adds a lot of code with many open()s, read()s and write()s that
could be abbreviated into single calls such as connect() and recv().
Have you thought of providing a more convenient API (such an
object-oriented Socket class that hides the vfs calls from the
application programmer)? Or do you consider using the fs session
interface to be better? If so, why?
--
Met vriendelijke groet / kind regards,
Boris Mulder
Cyber Security Labs B.V. | Gooimeer 6-31 | 1411 DD Naarden | The Netherlands
+31 35 631 3253 (office)
More information about the users
mailing list