


## socket.api
#
# This api extends the threadless socket--premicrothread.api with mailop
# constructors for the input operations and accept.
# Compiled by:
# src/lib/std/standard.lib### "Before long, you can step outside the bounds
### of the tools that have already been provided
### by the designers of the system and solve
### problems that don't quite fit the mold.
###
### "This is sometimes called hacking; in other contexts,
### it is called "engineering." In essence, it is the
### ability to build a tool when the right one is not
### already on hand."
###
### -- Tim O'Reilly
stipulate
package thk = threadkit; # threadkit is from src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkgherein
# This api is implemented in:
#
# src/lib/std/src/socket/socket.pkg #
api Socket {
#
Mailop(X) = thk::Mailop(X);
include Synchronous_Socket; # Synchronous_Socket is from src/lib/std/src/socket/synchronous-socket.api #
# We avoid dragging in the non-blocking
# ops from api Socket in socket--premicrothread.api.
# connect_mailop: (Threadkit_Socket( X, Y ), Socket_Address(X)) -> Mailop( Void );
# accept_mailop
# :
# Threadkit_Socket( X, Stream(Passive) )
# ->
# Mailop( ( Threadkit_Socket( X, Stream(Active) ),
# Socket_Address(X)
# ) );
# Socket input mailop constructors:
#
# 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)) );
};
end;
## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2013,
## released per terms of SMLNJ-COPYRIGHT.


