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/branches/primop-branch/src/system/Basis/Implementation/Sockets/win32-details.sml
ViewVC logotype

Annotation of /sml/branches/primop-branch/src/system/Basis/Implementation/Sockets/win32-details.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1471 - (view) (download)

1 : mblume 1389 (* win32-details.sml
2 :     *
3 :     * Check for would-block error condition on WinSockets.
4 :     *
5 :     * Copyright (c) 2003 by The Fellowship of SML/NJ
6 :     *
7 :     * Author: Matthias Blume (blume@tti-c.org)
8 :     *)
9 :     structure OpsysDetails : sig
10 :     val mkIODesc : int -> PreOS.IO.iodesc
11 :     val wrapNB_o : ('a -> 'b) -> ('a -> 'b option)
12 :     val wrapNB_b : ('a -> unit) -> ('a -> bool)
13 :     end = struct
14 :    
15 :     val mkIODesc = PreOS.IO.SockDesc
16 :    
17 :     (* This is a placeholder for a correct implementation that actually
18 :     * checks the error condition... *)
19 :     fun blockErr (OSImp.SysErr _) = true
20 :     | blockErr _ = false
21 :    
22 :     fun wrapNB_o f x = SOME (f x)
23 :     handle ex => if blockErr ex then NONE else raise ex
24 :    
25 :     fun wrapNB_b f x = (f x; true)
26 :     handle ex => if blockErr ex then false else raise ex
27 :     end

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