PreviousUpNext

14.4.95  Threadkit_Socket

The standard library Threadkit_Socket api defines access to TCP/IP network socket functionality for multithreaded Mythryl programs.

The Threadkit_Socket api is implemented by the threadkit_socket package.

The Threadkit_Socket api source code is in src/lib/std/src/socket/threadkit-socket.api.

See also: Socket_Junk.

See also: Posix_1003_1b.

See also: Threadkit_Synchronous_Socket.

See also: Socket.

The above information is manually maintained and may contain errors.

api {
    Mailop X = Mailop(X );
    Threadkit_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 socket : 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 control : api {
                          get_debug : Threadkit_Socket((X, Y) ) -> Bool;
                          set_debug : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_reuseaddr : Threadkit_Socket((X, Y) ) -> Bool;
                          set_reuseaddr : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_keepalive : Threadkit_Socket((X, Y) ) -> Bool;
                          set_keepalive : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_dontroute : Threadkit_Socket((X, Y) ) -> Bool;
                          set_dontroute : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_linger : Threadkit_Socket((X, Y) ) -> Null_Or(time::Time );
                          set_linger : (Threadkit_Socket((X, Y) ) , Null_Or(time::Time )) -> Void;
                          get_broadcast : Threadkit_Socket((X, Y) ) -> Bool;
                          set_broadcast : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_oobinline : Threadkit_Socket((X, Y) ) -> Bool;
                          set_oobinline : (Threadkit_Socket((X, Y) ) , Bool) -> Void;
                          get_sndbuf : Threadkit_Socket((X, Y) ) -> Int;
                          set_sndbuf : (Threadkit_Socket((X, Y) ) , Int) -> Void;
                          get_rcvbuf : Threadkit_Socket((X, Y) ) -> Int;
                          set_rcvbuf : (Threadkit_Socket((X, Y) ) , Int) -> Void;
                          get_type : Threadkit_Socket((X, Y) ) -> socket::Socket_Type;
                          get_error : Threadkit_Socket((X, Y) ) -> Bool;
                          get_peer_name : Threadkit_Socket((Y, X) ) -> Socket_Address(Y );
                          get_sock_name : Threadkit_Socket((Y, X) ) -> Socket_Address(Y );
                          get_nread : Threadkit_Socket((X, Y) ) -> Int;
                          get_atmark : Threadkit_Socket((X, Stream(Active )) ) -> Bool;
                      };;
    same_address : (Socket_Address(X ) , Socket_Address(X )) -> Bool;
    family_of_address : Socket_Address(X ) -> af::Address_Family;
    bind : (Threadkit_Socket((Y, X) ) , Socket_Address(Y )) -> Void;
    listen : (Threadkit_Socket((X, Stream(Passive )) ) , Int) -> Void;
    accept : Threadkit_Socket((X, Stream(Passive )) )
             -> (Threadkit_Socket((X, Stream(Active )) ) , Socket_Address(X ));
    connect : (Threadkit_Socket((Y, X) ) , Socket_Address(Y )) -> Void;
    close : Threadkit_Socket((X, Y) ) -> Void;
    Shutdown_Mode  = NO_RECVS | NO_RECVS_OR_SENDS | NO_SENDS;
    shutdown : (Threadkit_Socket((X, Stream(Y )) ) , Shutdown_Mode) -> Void;
    Socket_Descriptor ;
    socket_descriptor : Threadkit_Socket((X, Y) ) -> Socket_Descriptor;
    same_descriptor : (Socket_Descriptor , Socket_Descriptor) -> Bool;
    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 : Threadkit_Socket((X, Y) ) -> Int;
    Out_Flags  = {don't_route:Bool,  oob:Bool};
    In_Flags  = {oob:Bool,  peek:Bool};
    send_vector : (Threadkit_Socket((X, Stream(Active )) )
                   , vector_slice_of_one_byte_unts::Slice)
                  -> Int;
    send_rw_vector : (Threadkit_Socket((X, Stream(Active )) )
                      , rw_vector_slice_of_one_byte_unts::Slice)
                     -> Int;
    send_vector' : (Threadkit_Socket((X, Stream(Active )) )
                    , vector_slice_of_one_byte_unts::Slice , Out_Flags)
                   -> Int;
    send_rw_vector' : (Threadkit_Socket((X, Stream(Active )) )
                       , rw_vector_slice_of_one_byte_unts::Slice , Out_Flags)
                      -> Int;
    send_vector_to : (Threadkit_Socket((X, Datagram) ) , Socket_Address(X )
                      , vector_slice_of_one_byte_unts::Slice)
                     -> Void;
    send_rw_vector_to : (Threadkit_Socket((X, Datagram) ) , Socket_Address(X )
                         , rw_vector_slice_of_one_byte_unts::Slice)
                        -> Void;
    send_vector_to' : (Threadkit_Socket((X, Datagram) ) , Socket_Address(X )
                       , vector_slice_of_one_byte_unts::Slice , Out_Flags)
                      -> Void;
    send_rw_vector_to' : (Threadkit_Socket((X, Datagram) ) , Socket_Address(X )
                          , rw_vector_slice_of_one_byte_unts::Slice , Out_Flags)
                         -> Void;
    receive_vector : (Threadkit_Socket((X, Stream(Active )) ) , Int)
                     -> vector_of_one_byte_unts::Vector;
    receive_rw_vector : (Threadkit_Socket((X, Stream(Active )) )
                         , rw_vector_slice_of_one_byte_unts::Slice)
                        -> Int;
    receive_vector' : (Threadkit_Socket((X, Stream(Active )) ) , Int , In_Flags)
                      -> vector_of_one_byte_unts::Vector;
    receive_rw_vector' : (Threadkit_Socket((X, Stream(Active )) )
                          , rw_vector_slice_of_one_byte_unts::Slice , In_Flags)
                         -> Int;
    receive_vector_from : (Threadkit_Socket((X, Datagram) ) , Int)
                          -> (vector_of_one_byte_unts::Vector , Socket_Address(Y ));
    receive_rw_vector_from : (Threadkit_Socket((X, Datagram) )
                              , rw_vector_slice_of_one_byte_unts::Slice)
                             -> (Int , Socket_Address(X ));
    receive_vector_from' : (Threadkit_Socket((X, Datagram) ) , Int , In_Flags)
                           -> (vector_of_one_byte_unts::Vector , Socket_Address(Y ));
    receive_rw_vector_from' : (Threadkit_Socket((X, Datagram) )
                               , rw_vector_slice_of_one_byte_unts::Slice , In_Flags)
                              -> (Int , Socket_Address(X ));
    connect_mailop : (Threadkit_Socket((Y, X) ) , Socket_Address(Y )) -> Mailop(Void );
    accept_mailop : Threadkit_Socket((X, Stream(Passive )) )
                    -> Mailop(
                         ((Threadkit_Socket((X, Stream(Active )) ) , Socket_Address(X )))
                         );
    receive_vector_mailop : (Threadkit_Socket((X, Stream(Active )) ) , Int)
                            -> Mailop(vector_of_one_byte_unts::Vector );
    receive_rw_vector_mailop : (Threadkit_Socket((X, Stream(Active )) )
                                , rw_vector_slice_of_one_byte_unts::Slice)
                               -> Mailop(Int );
    receive_vector_mailop' : (Threadkit_Socket((X, Stream(Active )) ) , Int , In_Flags)
                             -> Mailop(vector_of_one_byte_unts::Vector );
    receive_rw_vector_mailop' : (Threadkit_Socket((X, Stream(Active )) )
                                 , rw_vector_slice_of_one_byte_unts::Slice , In_Flags)
                                -> Mailop(Int );
    receive_vector_from_mailop : (Threadkit_Socket((X, Datagram) ) , Int)
                                 -> Mailop(
                                      ((vector_of_one_byte_unts::Vector , Socket_Address(Y )))
                                      );
    receive_rw_vector_from_mailop : (Threadkit_Socket((X, Datagram) )
                                     , rw_vector_slice_of_one_byte_unts::Slice)
                                    -> Mailop(((Int , Socket_Address(X ))) );
    receive_vector_from_mailop' : (Threadkit_Socket((X, Datagram) ) , Int , In_Flags)
                                  -> Mailop(
                                       ((vector_of_one_byte_unts::Vector , Socket_Address(Y )))
                                       );
    receive_rw_vector_from_mailop' : (Threadkit_Socket((X, Datagram) )
                                      , rw_vector_slice_of_one_byte_unts::Slice , In_Flags)
                                     -> Mailop(((Int , Socket_Address(X ))) );
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext