| Standard ML Basis Library |
structure SocketImp : SOCKET =
struct
open PreSock
structure CI = CInterface
structure W8A = Word8Array
structure W8V = Word8Vector
structure AF =
struct
type addr_family = PreSock.addr_family
val listAddrFamilies
val list : unit -> (string * addr_family) list
val toString : addr_family -> string
val fromString : string -> addr_family option
end
structure SOCK =
struct
type sock_type = PreSock.sock_type
val listSockTypes
val stream : sock_type
val dgram : sock_type
val list : unit -> (string * sock_type) list
val toString : sock_type -> string
val fromString : string -> sock_type option
end
structure Ctl =
struct
val getDEBUG : ('a, 'b) sock -> bool
val setDEBUG : ('a, 'b) sock * bool -> unit
val getREUSEADDR : ('a, 'b) sock -> bool
val setREUSEADDR : ('a, 'b) sock * bool -> unit
val getKEEPALIVE : ('a, 'b) sock -> bool
val setKEEPALIVE : ('a, 'b) sock * bool -> unit
val getDONTROUTE : ('a, 'b) sock -> bool
val setDONTROUTE : ('a, 'b) sock * bool -> unit
val getLINGER : ('a, 'b) sock -> Time.time option
val setLINGER : ('a, 'b) sock * Time.time option -> unit
val getBROADCAST : ('a, 'b) sock -> bool
val setBROADCAST : ('a, 'b) sock * bool -> unit
val getOOBINLINE : ('a, 'b) sock -> bool
val setOOBINLINE : ('a, 'b) sock * bool -> unit
val getSNDBUF : ('a, 'b) sock -> int
val setSNDBUF : ('a, 'b) sock * int -> unit
val getRCVBUF : ('a, 'b) sock -> int
val setRCVBUF : ('a, 'b) sock * int -> unit
val getTYPE : ('a, 'b) sock -> SOCK.sock_type
val getERROR : ('a, 'b) sock -> bool
val getPeerName : ('a, 'b) sock -> 'a sock_addr
val getSockName : ('a, 'b) sock -> 'a sock_addr
val setNBIO : ('a, 'b) sock * bool -> unit
val getNREAD : ('a, 'b) sock -> int
val getATMARK : ('a, active stream) sock -> bool
end
type w8vector = W8V.vector
type w8array = W8A.array
type sockFD = PreSock.socket
type out_flags = {don't_route : bool, oob : bool}
type in_flags = {peek : bool, oob : bool}
type 'a buf = {buf : 'a, i : int, sz : int option}
datatype dgram = DGRAM
datatype 'a stream = STREAM
datatype passive = PASSIVE
datatype active = ACTIVE
datatype shutdown_mode = NO_RECVS | NO_SENDS | NO_RECVS_OR_SENDS
val sockFn
val netdbFun
val sameAddr : 'a sock_addr * 'a sock_addr -> bool
val familyOfAddr : 'a sock_addr -> AF.addr_family
val accept
: ('a, passive stream) sock -> ('a, active stream) sock * 'a sock_addr
val bind : ('a, 'b) sock * 'a sock_addr -> unit
val connect : ('a, 'b) sock * 'a sock_addr -> unit
val listen : ('a, passive stream) sock * int -> unit
val close : ('a, 'b) sock -> unit
val shutdown : ('a, 'b stream) sock * shutdown_mode -> unit
val pollDesc : ('a, 'b) sock -> OS.IO.poll_desc
val vbuf
val abuf
val dfltDon'tRoute
val dfltOOB
val dfltPeek
val sendVec : ('a, active stream) sock * Word8Vector.vector buf -> int
val sendArr : ('a, active stream) sock * Word8Array.array buf -> int
val sendVec'
: ('a, active stream) sock * Word8Vector.vector buf * out_flags -> int
val sendArr'
: ('a, active stream) sock * Word8Array.array buf * out_flags -> int
val sendVecTo
: ('a, dgram) sock * 'a sock_addr * Word8Vector.vector buf -> int
val sendArrTo : ('a, dgram) sock * 'a sock_addr * Word8Array.array buf -> int
val sendVecTo'
: ('a, dgram) sock * 'a sock_addr * Word8Vector.vector buf * out_flags ->
int
val sendArrTo'
: ('a, dgram) sock * 'a sock_addr * Word8Array.array buf * out_flags ->
int
val recvVec : ('a, active stream) sock * int -> Word8Vector.vector
val recvArr : ('a, active stream) sock * Word8Array.array buf -> int
val recvVec' : ('a, active stream) sock * int * in_flags -> Word8Vector.vector
val recvArr'
: ('a, active stream) sock * Word8Array.array buf * in_flags -> int
val recvVecFrom : ('a, dgram) sock * int -> Word8Vector.vector * 'b sock_addr
val recvArrFrom
: ('a, dgram) sock * {buf : Word8Array.array, i : int} ->
int * 'a sock_addr
val recvVecFrom'
: ('a, dgram) sock * int * in_flags -> Word8Vector.vector * 'b sock_addr
val recvArrFrom'
: ('a, dgram) sock * {buf : Word8Array.array, i : int} * in_flags ->
int * 'a sock_addr
end
Type detail |
---|
type w8vector = W8V.vector
type w8array = W8A.array
type sockFD = PreSock.socket
type out_flags = {don't_route : bool, oob : bool}
type in_flags = {peek : bool, oob : bool}
type 'a buf = {buf : 'a, i : int, sz : int option}
Datatype detail |
---|
datatype dgram = DGRAM
datatype 'a stream = STREAM
datatype passive = PASSIVE
datatype active = ACTIVE
datatype shutdown_mode = NO_RECVS | NO_SENDS | NO_RECVS_OR_SENDS
DataConstructor detail |
---|
constructor DGRAM : dgram
constructor STREAM : 'a stream
constructor PASSIVE : passive
constructor ACTIVE : active
constructor NO_RECVS : shutdown_mode
constructor NO_SENDS : shutdown_mode
constructor NO_RECVS_OR_SENDS : shutdown_mode
Value detail |
---|
val sockFn
val netdbFun
val sameAddr : 'a sock_addr * 'a sock_addr -> bool
val familyOfAddr : 'a sock_addr -> AF.addr_family
val accept
: ('a, passive stream) sock -> ('a, active stream) sock * 'a sock_addr
val bind : ('a, 'b) sock * 'a sock_addr -> unit
val connect : ('a, 'b) sock * 'a sock_addr -> unit
val listen : ('a, passive stream) sock * int -> unit
val close : ('a, 'b) sock -> unit
val shutdown : ('a, 'b stream) sock * shutdown_mode -> unit
val pollDesc : ('a, 'b) sock -> OS.IO.poll_desc
val vbuf
val abuf
val dfltDon'tRoute
val dfltOOB
val dfltPeek
val sendVec : ('a, active stream) sock * Word8Vector.vector buf -> int
val sendArr : ('a, active stream) sock * Word8Array.array buf -> int
val sendVec'
: ('a, active stream) sock * Word8Vector.vector buf * out_flags -> int
val sendArr'
: ('a, active stream) sock * Word8Array.array buf * out_flags -> int
val sendVecTo : ('a, dgram) sock * 'a sock_addr * Word8Vector.vector buf -> int
val sendArrTo : ('a, dgram) sock * 'a sock_addr * Word8Array.array buf -> int
val sendVecTo'
: ('a, dgram) sock * 'a sock_addr * Word8Vector.vector buf * out_flags ->
int
val sendArrTo'
: ('a, dgram) sock * 'a sock_addr * Word8Array.array buf * out_flags -> int
val recvVec : ('a, active stream) sock * int -> Word8Vector.vector
val recvArr : ('a, active stream) sock * Word8Array.array buf -> int
val recvVec' : ('a, active stream) sock * int * in_flags -> Word8Vector.vector
val recvArr' : ('a, active stream) sock * Word8Array.array buf * in_flags -> int
val recvVecFrom : ('a, dgram) sock * int -> Word8Vector.vector * 'b sock_addr
val recvArrFrom
: ('a, dgram) sock * {buf : Word8Array.array, i : int} -> int * 'a sock_addr
val recvVecFrom'
: ('a, dgram) sock * int * in_flags -> Word8Vector.vector * 'b sock_addr
val recvArrFrom'
: ('a, dgram) sock * {buf : Word8Array.array, i : int} * in_flags ->
int * 'a sock_addr
| Standard ML Basis Library |
This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.
Copyright © 2003 AT&T and Lucent Technologies. All rights reserved.
Permission is granted for internet users to make one paper copy for their
own personal use. Further hardcopy reproduction is strictly prohibited.
Permission to distribute the HTML document electronically on any medium
other than the internet must be requested from the copyright holders by
contacting the editors.
Printed versions of the SML Basis Manual are available from Cambridge
University Press.
To order, please visit
www.cup.org (North America) or
www.cup.cam.ac.uk (outside North America). |