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

SCM Repository

[smlnj] View of /sml/branches/primop-branch/src/system/Basis/Implementation/Sockets/win32-details.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1470 - (download) (annotate)
Mon Mar 29 22:45:55 2004 UTC (15 years, 11 months ago)
File size: 770 byte(s)
This commit was manufactured by cvs2svn to create branch
'primop-branch'.
(* win32-details.sml
 *
 *   Check for would-block error condition on WinSockets.
 *
 * Copyright (c) 2003 by The Fellowship of SML/NJ
 *
 * Author: Matthias Blume (blume@tti-c.org)
 *)
structure OpsysDetails : sig
    val mkIODesc : int -> PreOS.IO.iodesc
    val wrapNB_o : ('a -> 'b) -> ('a -> 'b option)
    val wrapNB_b : ('a -> unit) -> ('a -> bool)
end = struct

    val mkIODesc = PreOS.IO.SockDesc

    (* This is a placeholder for a correct implementation that actually
     * checks the error condition... *)
    fun blockErr (OSImp.SysErr _) = true
      | blockErr _ = false

    fun wrapNB_o f x = SOME (f x)
	handle ex => if blockErr ex then NONE else raise ex

    fun wrapNB_b f x = (f x; true)
	handle ex => if blockErr ex then false else raise ex
end

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