PreviousUpNext

14.4.96  Socket__Premicrothread

The standard library Socket__Premicrothread api defines access to TCP/IP network socket functionality.

The Socket__Premicrothread api is implemented by the socket__premicrothread package.

The Socket__Premicrothread api source code is in src/lib/std/src/socket/socket–premicrothread.api.

See also: Socket_Junk.

See also: Posixlib.

See also: Synchronous_Socket.

See also: Socket. The above information is manually maintained and may contain errors.

api {
    Socket (X, Y);
    Socket_Address X;
    Datagram;
    Stream X;
    Passive;
    Active;
        package af
          : api {
                Address_Family  = Address_Family;
                list : Void -> List(((String , Address_Family)) );
                to_string : Address_Family -> String;
                from_string : String -> Null_Or(Address_Family );};;
        package typ
          : api {
                eqtype Socket_Type;
                stream : Socket_Type;
                datagram : Socket_Type;
                list : Void -> List(((String , Socket_Type)) );
                to_string : Socket_Type -> String;
                from_string : String -> Null_Or(Socket_Type );};;
        package ctl
          : api {
                get_debug : Socket((X, Y)) -> Bool;
                set_debug : (Socket((X, Y)) , Bool) -> Void;
                get_reuseaddr : Socket((X, Y)) -> Bool;
                set_reuseaddr : (Socket((X, Y)) , Bool) -> Void;
                get_keepalive : Socket((X, Y)) -> Bool;
                set_keepalive : (Socket((X, Y)) , Bool) -> Void;
                get_dontroute : Socket((X, Y)) -> Bool;
                set_dontroute : (Socket((X, Y)) , Bool) -> Void;
                get_linger : Socket((X, Y)) -> Null_Or(time::Time );
                set_linger : (Socket((X, Y)) , Null_Or(time::Time )) -> Void;
                get_broadcast : Socket((X, Y)) -> Bool;
                set_broadcast : (Socket((X, Y)) , Bool) -> Void;
                get_oobinline : Socket((X, Y)) -> Bool;
                set_oobinline : (Socket((X, Y)) , Bool) -> Void;
                get_sndbuf : Socket((X, Y)) -> Int;
                set_sndbuf : (Socket((X, Y)) , Int) -> Void;
                get_rcvbuf : Socket((X, Y)) -> Int;
                set_rcvbuf : (Socket((X, Y)) , Int) -> Void;
                get_type : Socket((X, Y)) -> typ::Socket_Type;
                get_error : Socket((X, Y)) -> Bool;
                get_peer_name : Socket((Y, X)) -> Socket_Address(Y );
                get_sock_name : Socket((Y, X)) -> Socket_Address(Y );
                get_nread : Socket((X, Y)) -> Int;
                get_atmark : Socket((X, Stream(Active ))) -> Bool;};;
    same_address : (Socket_Address(X ) , Socket_Address(X )) -> Bool;
    family_of_address : Socket_Address(X ) -> af::Address_Family;
    bind : (Socket((Y, X)) , Socket_Address(Y )) -> Void;
    listen : (Socket((X, Stream(Passive ))) , Int) -> Void;
    accept : Socket((X, Stream(Passive ))) -> (Socket((X, Stream(Active ))) , Socket_Address(X ));
    connect : (Socket((Y, X)) , Socket_Address(Y )) -> Void;
    close : Socket((X, Y)) -> Void;
    Shutdown_Mode  = NO_RECVS | NO_RECVS_OR_SENDS | NO_SENDS;
    shutdown : (Socket((X, Stream(Y ))) , Shutdown_Mode) -> Void;
    Socket_Descriptor;
    socket_descriptor : Socket((X, Y)) -> Socket_Descriptor;
    same_descriptor : (Socket_Descriptor , Socket_Descriptor) -> Bool;
        wait_for_io_opportunity :
                {oobdable:List(Socket_Descriptor ), readable:List(Socket_Descriptor ), timeout:Null_Or(time::Time ),
                writable:List(Socket_Descriptor )}
            ->  {oobdable:List(Socket_Descriptor ), readable:List(Socket_Descriptor ),
                writable:List(Socket_Descriptor )};
        select :{oobdable:List(Socket_Descriptor ), readable:List(Socket_Descriptor ), timeout:Null_Or(time::Time ),
                writable:List(Socket_Descriptor )}
            ->  {oobdable:List(Socket_Descriptor ), readable:List(Socket_Descriptor ),
                writable:List(Socket_Descriptor )};
    io_descriptor : Socket((X, Y)) -> Int;
    Out_Flags  = {don't_route:Bool, oob:Bool};
    In_Flags  = {oob:Bool, peek:Bool};
    send_vector : (Socket((X, Stream(Active ))) , vector_slice_of_one_byte_unts::Slice) -> Int;
    send_rw_vector : (Socket((X, Stream(Active ))) , rw_vector_slice_of_one_byte_unts::Slice) -> Int;
        send_vector' :
        (Socket((X, Stream(Active ))) , vector_slice_of_one_byte_unts::Slice , Out_Flags) -> Int;
        send_rw_vector' :
        (Socket((X, Stream(Active ))) , rw_vector_slice_of_one_byte_unts::Slice , Out_Flags) -> Int;
        send_vector_to :
        (Socket((X, Datagram)) , Socket_Address(X ) , vector_slice_of_one_byte_unts::Slice) -> Void;
        send_rw_vector_to :
        (Socket((X, Datagram)) , Socket_Address(X ) , rw_vector_slice_of_one_byte_unts::Slice) -> Void;
        send_vector_to' :
            (Socket((X, Datagram)) , Socket_Address(X ) , vector_slice_of_one_byte_unts::Slice , Out_Flags)
            ->
            Void;
        send_rw_vector_to' :
            (Socket((X, Datagram)) , Socket_Address(X ) , rw_vector_slice_of_one_byte_unts::Slice , Out_Flags)
            ->
            Void;
    receive_vector : (Socket((X, Stream(Active ))) , Int) -> vector_of_one_byte_unts::Vector;
    receive_rw_vector : (Socket((X, Stream(Active ))) , rw_vector_slice_of_one_byte_unts::Slice) -> Int;
        receive_vector' :
        (Socket((X, Stream(Active ))) , Int , In_Flags) -> vector_of_one_byte_unts::Vector;
        receive_rw_vector' :
        (Socket((X, Stream(Active ))) , rw_vector_slice_of_one_byte_unts::Slice , In_Flags) -> Int;
        receive_vector_from :
        (Socket((X, Datagram)) , Int) -> (vector_of_one_byte_unts::Vector , Socket_Address(Y ));
        receive_rw_vector_from :
        (Socket((X, Datagram)) , rw_vector_slice_of_one_byte_unts::Slice) -> (Int , Socket_Address(X ));
        receive_vector_from' :
        (Socket((X, Datagram)) , Int , In_Flags) -> (vector_of_one_byte_unts::Vector , Socket_Address(Y ));
        receive_rw_vector_from' :
            (Socket((X, Datagram)) , rw_vector_slice_of_one_byte_unts::Slice , In_Flags)
            ->
            (Int , Socket_Address(X ));
    Socket_Fd;
    Internet_Address;
    Raw_Address_Family;
    Wy8Vector;
    Wy8Array;
    list_addr_families__syscall : Void -> List(mythryl_callable_c_library_interface::System_Constant );
        set__list_addr_families__ref :
                (   {fun_name:String, io_call:Void -> List(mythryl_callable_c_library_interface::System_Constant ),
                    lib_name:String}
                ->
                Void -> List(mythryl_callable_c_library_interface::System_Constant )
                )
            ->
            Void;
    list_socket_types__syscall : Void -> List(mythryl_callable_c_library_interface::System_Constant );
        set__list_socket_types__ref :
                (   {fun_name:String, io_call:Void -> List(mythryl_callable_c_library_interface::System_Constant ),
                    lib_name:String}
                ->
                Void -> List(mythryl_callable_c_library_interface::System_Constant )
                )
            ->
            Void;
    ctl_debug__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_debug__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_reuseaddr__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_reuseaddr__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_keepalive__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_keepalive__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_dontroute__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_dontroute__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_broadcast__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_broadcast__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_oobinline__syscall : (Socket_Fd , Null_Or(Bool )) -> Bool;
        set__ctl_oobinline__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Bool )) -> Bool, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Bool )) -> Bool
                )
            ->
            Void;
    ctl_sndbuf__syscall : (Socket_Fd , Null_Or(Int )) -> Int;
        set__ctl_sndbuf__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Int )) -> Int, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Int )) -> Int
                )
            ->
            Void;
    ctl_rcvbuf__syscall : (Socket_Fd , Null_Or(Int )) -> Int;
        set__ctl_rcvbuf__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Int )) -> Int, lib_name:String}
                ->
                (Socket_Fd , Null_Or(Int )) -> Int
                )
            ->
            Void;
    ctl_linger__syscall : (Socket_Fd , Null_Or(Null_Or(Int ) )) -> Null_Or(Int );
        set__ctl_linger__ref :
                (
                {fun_name:String, io_call:(Socket_Fd , Null_Or(Null_Or(Int ) )) -> Null_Or(Int ), lib_name:String}
                ->
                (Socket_Fd , Null_Or(Null_Or(Int ) )) -> Null_Or(Int )
                )
            ->
            Void;
    get_type__syscall : Socket_Fd -> mythryl_callable_c_library_interface::System_Constant;
        set__get_type__ref :
                (   {fun_name:String, io_call:Socket_Fd -> mythryl_callable_c_library_interface::System_Constant,
                    lib_name:String}
                ->
                Socket_Fd -> mythryl_callable_c_library_interface::System_Constant
                )
            ->
            Void;
    get_error__syscall : Socket_Fd -> Bool;
        set__get_error__ref :
        ({fun_name:String, io_call:Socket_Fd -> Bool, lib_name:String} -> Socket_Fd -> Bool) -> Void;
    get_peer_name__syscall : Socket_Fd -> Internet_Address;
        set__get_peer_name__ref :
                (
                {fun_name:String, io_call:Socket_Fd -> Internet_Address, lib_name:String}
                ->
                Socket_Fd -> Internet_Address
                )
            ->
            Void;
    get_sock_name__syscall : Socket_Fd -> Internet_Address;
        set__get_sock_name__ref :
                (
                {fun_name:String, io_call:Socket_Fd -> Internet_Address, lib_name:String}
                ->
                Socket_Fd -> Internet_Address
                )
            ->
            Void;
    get_nread__syscall : Socket_Fd -> Int;
        set__get_nread__ref :
        ({fun_name:String, io_call:Socket_Fd -> Int, lib_name:String} -> Socket_Fd -> Int) -> Void;
    get_atmark__syscall : Socket_Fd -> Bool;
        set__get_atmark__ref :
        ({fun_name:String, io_call:Socket_Fd -> Bool, lib_name:String} -> Socket_Fd -> Bool) -> Void;
    set_nonblockingio__syscall : (Socket_Fd , Bool) -> Void;
        set__set_nonblockingio__ref :
            ({fun_name:String, io_call:(Socket_Fd , Bool) -> Void, lib_name:String} -> (Socket_Fd , Bool) -> Void)
            ->
            Void;
    get_address_family__syscall : Internet_Address -> Raw_Address_Family;
        set__get_address_family__ref :
                (
                {fun_name:String, io_call:Internet_Address -> Raw_Address_Family, lib_name:String}
                ->
                Internet_Address -> Raw_Address_Family
                )
            ->
            Void;
    accept__syscall : Int -> (Int , Internet_Address);
        set__accept__ref :
                (
                {fun_name:String, io_call:Int -> (Int , Internet_Address), lib_name:String}
                ->
                Int -> (Int , Internet_Address)
                )
            ->
            Void;
    bind__syscall : (Int , Internet_Address) -> Void;
        set__bind__ref :
                (
                {fun_name:String, io_call:(Int , Internet_Address) -> Void, lib_name:String}
                ->
                (Int , Internet_Address) -> Void
                )
            ->
            Void;
    connect__syscall : (Int , Internet_Address) -> Void;
        set__connect__ref :
                (
                {fun_name:String, io_call:(Int , Internet_Address) -> Void, lib_name:String}
                ->
                (Int , Internet_Address) -> Void
                )
            ->
            Void;
    listen__syscall : (Int , Int) -> Void;
        set__listen__ref :
        ({fun_name:String, io_call:(Int , Int) -> Void, lib_name:String} -> (Int , Int) -> Void) -> Void;
    close__syscall : Int -> Void;
    set__close__ref : ({fun_name:String, io_call:Int -> Void, lib_name:String} -> Int -> Void) -> Void;
    shutdown__syscall : (Int , Int) -> Void;
        set__shutdown__ref :
        ({fun_name:String, io_call:(Int , Int) -> Void, lib_name:String} -> (Int , Int) -> Void) -> Void;
    send_v__syscall : (Int , Wy8Vector , Int , Int , Bool , Bool) -> Int;
        set__send_v__ref :
                (
                {fun_name:String, io_call:(Int , Wy8Vector , Int , Int , Bool , Bool) -> Int, lib_name:String}
                ->
                (Int , Wy8Vector , Int , Int , Bool , Bool) -> Int
                )
            ->
            Void;
    send_a__syscall : (Int , Wy8Array , Int , Int , Bool , Bool) -> Int;
        set__send_a__ref :
                (
                {fun_name:String, io_call:(Int , Wy8Array , Int , Int , Bool , Bool) -> Int, lib_name:String}
                ->
                (Int , Wy8Array , Int , Int , Bool , Bool) -> Int
                )
            ->
            Void;
    send_to_v__syscall : (Int , Wy8Vector , Int , Int , Bool , Bool , Internet_Address) -> Int;
        set__send_to_v__ref :
                (   {fun_name:String, io_call:(Int , Wy8Vector , Int , Int , Bool , Bool , Internet_Address) -> Int,
                    lib_name:String}
                ->
                (Int , Wy8Vector , Int , Int , Bool , Bool , Internet_Address) -> Int
                )
            ->
            Void;
    send_to_a__syscall : (Int , Wy8Array , Int , Int , Bool , Bool , Internet_Address) -> Int;
        set__send_to_a__ref :
                (   {fun_name:String, io_call:(Int , Wy8Array , Int , Int , Bool , Bool , Internet_Address) -> Int,
                    lib_name:String}
                ->
                (Int , Wy8Array , Int , Int , Bool , Bool , Internet_Address) -> Int
                )
            ->
            Void;
    recv_v__syscall : (Int , Int , Bool , Bool) -> Wy8Vector;
        set__recv_v__ref :
                (
                {fun_name:String, io_call:(Int , Int , Bool , Bool) -> Wy8Vector, lib_name:String}
                ->
                (Int , Int , Bool , Bool) -> Wy8Vector
                )
            ->
            Void;
    recv_a__syscall : (Int , Wy8Array , Int , Int , Bool , Bool) -> Int;
        set__recv_a__ref :
                (
                {fun_name:String, io_call:(Int , Wy8Array , Int , Int , Bool , Bool) -> Int, lib_name:String}
                ->
                (Int , Wy8Array , Int , Int , Bool , Bool) -> Int
                )
            ->
            Void;
    recv_from_v__syscall : (Int , Int , Bool , Bool) -> (Wy8Vector , Internet_Address);
        set__recv_from_v__ref :
                (   {fun_name:String, io_call:(Int , Int , Bool , Bool) -> (Wy8Vector , Internet_Address),
                    lib_name:String}
                ->
                (Int , Int , Bool , Bool) -> (Wy8Vector , Internet_Address)
                )
            ->
            Void;
    recv_from_a__syscall : (Int , Wy8Array , Int , Int , Bool , Bool) -> (Int , Internet_Address);
        set__recv_from_a__ref :
                (   {fun_name:String, io_call:(Int , Wy8Array , Int , Int , Bool , Bool) -> (Int , Internet_Address),
                    lib_name:String}
                ->
                (Int , Wy8Array , Int , Int , Bool , Bool) -> (Int , Internet_Address)
                )
            ->
            Void;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext