PreviousUpNext

15.4.1181  src/lib/std/src/socket/threadkit-plain-socket.pkg

## threadkit-plain-socket.pkg

# Compiled by:
#     src/lib/std/standard.lib

stipulate
    package pre =  threadkit_pre_socket;                                # threadkit_pre_socket          is from   src/lib/std/src/socket/threadkit-pre-socket.pkg
    package ps  =  plain_socket;                                        # plain_socket                  is from   src/lib/std/src/socket/plain-socket.pkg
herein

    package   threadkit_plain_socket
    : (weak)  Threadkit_Plain_Socket                                    # Threadkit_Plain_Socket        is from   src/lib/std/src/socket/threadkit-plain-socket.api
    {
    /*
        # Return a list of the supported address families.
        # This should include at least:  socket::af::inet.
        #
        addressFamilies = ps::addressFamilies

        # Return a list of the supported socket types.
        # This should include at least:
        #     socket::SOCKET::stream
        #     socket::SOCKET::dgram.
        #
        socketTypes = ps::socketTypes
    */


        fun socket arg                                                  # Create sockets using default protocol.
            =
            pre::make_socket (ps::socket arg);

        fun socket_pair arg
            =
            {   (ps::socket_pair  arg)
                    ->
                    (s1, s2);

                ( pre::make_socket s1,
                  pre::make_socket s2
                );
            };

        fun socket' arg                                                 # Create sockets using the specified protocol.
            =
            pre::make_socket (ps::socket' arg);

        fun socket_pair' arg
            =
            {   (ps::socket_pair'  arg)
                    ->
                    (s1, s2);

                ( pre::make_socket s1,
                  pre::make_socket s2
                );
            };

    };
end;

## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2012,
## released under Gnu Public Licence version 3.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext