Overview  Index  Help 
Standard ML Basis Library

SOCKET

All Known Implementing Modules:

SocketImpSocket


signature SOCKET =
sig
  structure AF :
  sig
    type addr_family = NetHostDB.addr_family
    val list : unit -> (string * addr_familylist
    val toString : addr_family -> string
    val fromString : string -> addr_family option
  end
  structure SOCK :
  sig
    eqtype sock_type
    val stream : sock_type
    val dgram : sock_type
    val list : unit -> (string * sock_typelist
    val toString : sock_type -> string
    val fromString : string -> sock_type option
  end
  structure Ctl :
  sig
    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 streamsock -> bool
  end
  type ('af, 'sock) sock
  type 'af sock_addr
  type dgram
  type 'a stream
  type passive
  type active
  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 shutdown_mode = NO_RECVS | NO_SENDS | NO_RECVS_OR_SENDS
  val sameAddr : 'a sock_addr * 'a sock_addr -> bool
  val familyOfAddr : 'a sock_addr -> AF.addr_family
  val accept
      : ('a, passive streamsock -> ('a, active streamsock * '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 streamsock * int -> unit
  val close : ('a, 'b) sock -> unit
  val shutdown : ('a, 'b streamsock * shutdown_mode -> unit
  val pollDesc : ('a, 'b) sock -> OS.IO.poll_desc
  val sendVec : ('a, active streamsock * Word8Vector.vector buf -> int
  val sendArr : ('a, active streamsock * Word8Array.array buf -> int
  val sendVec'
      : ('a, active streamsock * Word8Vector.vector buf * out_flags -> int
  val sendArr'
      : ('a, active streamsock * Word8Array.array buf * out_flags -> int
  val sendVecTo
      : ('a, dgramsock * 'a sock_addr * Word8Vector.vector buf -> int
  val sendArrTo : ('a, dgramsock * 'a sock_addr * Word8Array.array buf -> int
  val sendVecTo'
      : ('a, dgramsock * 'a sock_addr * Word8Vector.vector buf * out_flags ->
          int
  val sendArrTo'
      : ('a, dgramsock * 'a sock_addr * Word8Array.array buf * out_flags ->
          int
  val recvVec : ('a, active streamsock * int -> Word8Vector.vector
  val recvArr : ('a, active streamsock * Word8Array.array buf -> int
  val recvVec' : ('a, active streamsock * int * in_flags -> Word8Vector.vector
  val recvArr'
      : ('a, active streamsock * Word8Array.array buf * in_flags -> int
  val recvVecFrom : ('a, dgramsock * int -> Word8Vector.vector * 'b sock_addr
  val recvArrFrom
      : ('a, dgramsock * {buf : Word8Array.array, i : int} ->
          int * 'a sock_addr
  val recvVecFrom'
      : ('a, dgramsock * int * in_flags -> Word8Vector.vector * 'b sock_addr
  val recvArrFrom'
      : ('a, dgramsock * {buf : Word8Array.array, i : int} * in_flags ->
          int * 'a sock_addr
end

 
Type detail

sock

type ('af, 'sock) sock


sock_addr

type 'af sock_addr


dgram

type dgram


stream

type 'a stream


passive

type passive


active

type active


out_flags

type out_flags = {don't_route : bool, oob : bool}


in_flags

type in_flags = {peek : bool, oob : bool}


buf

type 'a buf = {buf : 'a, i : int, sz : int option}

 
Datatype detail

shutdown_mode

datatype shutdown_mode = NO_RECVS | NO_SENDS | NO_RECVS_OR_SENDS

 
DataConstructor detail

NO_RECVS

constructor NO_RECVS : shutdown_mode


NO_SENDS

constructor NO_SENDS : shutdown_mode


NO_RECVS_OR_SENDS

constructor NO_RECVS_OR_SENDS : shutdown_mode

 
Value detail

sameAddr

val sameAddr : 'a sock_addr * 'a sock_addr -> bool


familyOfAddr

val familyOfAddr : 'a sock_addr -> AF.addr_family


accept

val accept
    : ('a, passive streamsock -> ('a, active streamsock * 'a sock_addr


bind

val bind : ('a, 'b) sock * 'a sock_addr -> unit


connect

val connect : ('a, 'b) sock * 'a sock_addr -> unit


listen

val listen : ('a, passive streamsock * int -> unit


close

val close : ('a, 'b) sock -> unit


shutdown

val shutdown : ('a, 'b streamsock * shutdown_mode -> unit


pollDesc

val pollDesc : ('a, 'b) sock -> OS.IO.poll_desc


sendVec

val sendVec : ('a, active streamsock * Word8Vector.vector buf -> int


sendArr

val sendArr : ('a, active streamsock * Word8Array.array buf -> int


sendVec'

val sendVec'
    : ('a, active streamsock * Word8Vector.vector buf * out_flags -> int


sendArr'

val sendArr'
    : ('a, active streamsock * Word8Array.array buf * out_flags -> int


sendVecTo

val sendVecTo : ('a, dgramsock * 'a sock_addr * Word8Vector.vector buf -> int


sendArrTo

val sendArrTo : ('a, dgramsock * 'a sock_addr * Word8Array.array buf -> int


sendVecTo'

val sendVecTo'
    : ('a, dgramsock * 'a sock_addr * Word8Vector.vector buf * out_flags ->
        int


sendArrTo'

val sendArrTo'
    : ('a, dgramsock * 'a sock_addr * Word8Array.array buf * out_flags -> int


recvVec

val recvVec : ('a, active streamsock * int -> Word8Vector.vector


recvArr

val recvArr : ('a, active streamsock * Word8Array.array buf -> int


recvVec'

val recvVec' : ('a, active streamsock * int * in_flags -> Word8Vector.vector


recvArr'

val recvArr' : ('a, active streamsock * Word8Array.array buf * in_flags -> int


recvVecFrom

val recvVecFrom : ('a, dgramsock * int -> Word8Vector.vector * 'b sock_addr


recvArrFrom

val recvArrFrom
    : ('a, dgramsock * {buf : Word8Array.array, i : int} -> int * 'a sock_addr


recvVecFrom'

val recvVecFrom'
    : ('a, dgramsock * int * in_flags -> Word8Vector.vector * 'b sock_addr


recvArrFrom'

val recvArrFrom'
    : ('a, dgramsock * {buf : Word8Array.array, i : int} * in_flags ->
        int * 'a sock_addr

 


Overview  Index  Help 
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).