INetSock
structure
signature INET_SOCK
(* OPTIONAL *)
structure INetSock
:> INET_SOCK (* OPTIONAL *)
This structure provides operations for creating and manipulating Internet-domain addresses and sockets.
type inet
type 'sock_type sock = (inet, 'sock_type) Socket.sock
type 'mode stream_sock = 'mode Socket.stream sock
type dgram_sock = Socket.dgram sock
type sock_addr = inet Socket.sock_addr
val inetAF : Socket.AF.addr_family
val toAddr : NetHostDB.in_addr * int -> sock_addr
val fromAddr : sock_addr -> NetHostDB.in_addr * int
val any : int -> sock_addr
structure UDP : sig
val socket : unit -> dgram_sock
val socket' : int -> dgram_sock
end
structure TCP : sig
val socket : unit -> 'mode stream_sock
val socket' : int -> 'mode stream_sock
val getNODELAY : 'mode stream_sock -> bool
val setNODELAY : 'mode stream_sock * bool -> unit
end
type inet
type 'mode stream_sock = 'mode Socket.stream sock
Socket.active
or Socket.passive
.
type dgram_sock = Socket.dgram sock
type sock_addr = inet Socket.sock_addr
val inetAF : Socket.AF.addr_family
toAddr (ia, i)
val fromAddr : sock_addr -> NetHostDB.in_addr * int
(ia,i)
of an Internet address ia
and a port number i
.
any port
INADDR_ANY
constant in the C Sockets API. The values created by this function are used to bind
a socket to a specific port.
structure UDP
val socket : unit -> dgram_sock
SysErr
if there are too many sockets in use.
socket' prot
0
is equivalent to socket
()
. It raises SysErr
if there are too many sockets in use.
structure TCP
val socket : unit -> 'mode stream_sock
SysErr
if there are too many sockets in use.
socket' prot
0
is equivalent to socket
()
.
val getNODELAY : 'mode stream_sock -> bool
val setNODELAY : 'mode stream_sock * bool -> unit
TCP_NODELAY
flag on the socket. When set to false
(the default), there is only a single small packet allowed to be outstanding on a given TCP connection at any time, thereby reducing small packet traffic on slower WANs. When set to true
, packets are sent as fast as possible. [[Refer to Stevens, p.316.]]
GenericSock
,NetHostDB
,Socket
,UnixSock
Generated April 12, 2004
Last Modified June 5, 1998
Comments to John Reppy.
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 © 2004 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). |