Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cml/src/Sockets/cml-generic-sock.sml
ViewVC logotype

Annotation of /sml/trunk/src/cml/src/Sockets/cml-generic-sock.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 2 (* cml-generic-sock.sml
2 :     *
3 :     * COPYRIGHT (c) 1996 AT&T Research.
4 :     *)
5 :    
6 :     structure CML_GenericSock : GENERIC_SOCK =
7 :     struct
8 :    
9 :     (* returns a list of the supported address families; this should include
10 :     * at least: Socket.AF.inet.
11 :     *)
12 :     val addressFamilies = GenericSock.addressFamilies
13 :    
14 :     (* returns a list of the supported socket types; this should include at
15 :     * least: Socket.SOCK.stream and Socket.SOCK.dgram.
16 :     *)
17 :     val socketTypes = GenericSock.socketTypes
18 :    
19 :     (* create sockets using default protocol *)
20 :     fun socket arg = PreSock.mkSock(GenericSock.socket arg)
21 :     fun socketPair arg = let
22 :     val (s1, s2) = GenericSock.socketPair arg
23 :     in
24 :     (PreSock.mkSock s1, PreSock.mkSock s2)
25 :     end
26 :    
27 :     (* create sockets using the specified protocol *)
28 :     fun socket' arg = PreSock.mkSock(GenericSock.socket' arg)
29 :     fun socketPair' arg = let
30 :     val (s1, s2) = GenericSock.socketPair' arg
31 :     in
32 :     (PreSock.mkSock s1, PreSock.mkSock s2)
33 :     end
34 :    
35 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0