Commit Graph

4 Commits

Author SHA1 Message Date
Ralf Corsepius
caeacbccc5 2004-04-22 Ralf Corsepius <ralf_corsepius@rtems.org>
* libnetworking/sys/protosw.h: Partial update from FreeBSD.
	* libnetworking/sys/socket.h: Partial update from FreeBSD.
	* libnetworking/rtems/rtems_syscall.c: Reflect changes to socket.h.
2004-04-22 04:04:21 +00:00
Ralf Corsepius
dc28f16d8e Use -D_KERNEL instead of -DKERNEL for greater FreeBSD compliance. 2004-04-20 12:28:19 +00:00
Joel Sherrill
a6f3cff703 Patch from Ian Lance Taylor <ian@airs.com>:
The select function is not particularly efficient when dealing with a
    large number of sockets.  The application has to build a big set of
    bits and pass it in.  RTEMS has to look through all those bits and see
    what is ready.  Then the application has to look through all the bits
    again.

    On the other hand, when using RTEMS, the select function is needed
    exactly when you have a large number of sockets, because that is when
    it becomes prohibitive to use a separate thread for each socket.

    I think it would make more sense for RTEMS to support callback
    functions which could be invoked when there is data available to read
    from a socket, or when there is space available to write to a socket.

    Accordingly, I implemented them.

    This patch adds two new SOL_SOCKET options to setsockopt and
    getsockopt: SO_SNDWAKEUP and SO_RCVWAKEUP.  They take arguments of
    type struct sockwakeup:

    struct  sockwakeup {
        void    (*sw_pfn) __P((struct socket *, caddr_t));
        caddr_t sw_arg;
    };

    They are used to add or remove a function which will be called when
    something happens for the socket.  Getting a callback doesn't imply
    that a read or write will succeed, but it does imply that it is worth
    trying.

    This adds functionality to RTEMS which is somewhat like interrupt
    driven socket I/O on Unix.

    After the patch to RTEMS, I have appended a patch to
    netdemos-19990407/select/test.c to test the new functionality and
    demonstrate one way it might be used.  To run the new test instead of
    the select test, change doSocket to call echoServer2 instead of
    echoServer.
1999-06-11 14:11:44 +00:00
Joel Sherrill
39e6e65a2c Base files 1998-08-19 21:32:28 +00:00