Commits

Anonymous committed ee51366

Changed jack/plug to fix/pad and merged `Complete with `Wait for signaling
that all octets have been written.

  • Participants
  • Parent commits b9ec842

Comments (0)

Files changed (17)

 iom_reactor.cmi: iom_stream.cmi iom_octet_stream.cmi iom_gadget.cmi 
 iom_pipe.cmi: iom_stream.cmi iom_reactor.cmi iom_octet_stream.cmi \
     iom_gadget.cmi 
-iom_socket.cmi: iom_stream.cmi iom_reactor.cmi iom_gadget.cmi 
+iom_socket.cmi: iom_stream.cmi iom_gadget.cmi 
 iom_sock_stream.cmi: iom_stream.cmi iom_socket.cmi iom_reactor.cmi \
     iom_octet_stream.cmi iom_gadget.cmi 
 iom_tcp4_socket.cmi: iom_sock_stream.cmi 
     iom_pipe.cmi 
 iom_pipe.cmx: iom_stream.cmx iom_reactor.cmx iom_octet_stream.cmx \
     iom_pipe.cmi 
-iom_socket.cmo: iom_stream.cmi iom_reactor.cmi iom_gadget.cmi iom_socket.cmi 
-iom_socket.cmx: iom_stream.cmx iom_reactor.cmx iom_gadget.cmx iom_socket.cmi 
+iom_socket.cmo: iom_stream.cmi iom_gadget.cmi iom_socket.cmi 
+iom_socket.cmx: iom_stream.cmx iom_gadget.cmx iom_socket.cmi 
 iom_sock_stream.cmo: iom_stream.cmi iom_socket.cmi iom_reactor.cmi \
     iom_octet_stream.cmi iom_gadget.cmi iom_sock_stream.cmi 
 iom_sock_stream.cmx: iom_stream.cmx iom_socket.cmx iom_reactor.cmx \
 
 Highlights of this release:
 
++ Renamed [plug] to [pad] and [jack] to [com] conventionally throughout.
 + Migrate to using new "Network Extensions" (Nx) library.
 + Consolidated Iom_stream.produce and Iom_stream.consume into
   Iom_layer.transform and swapped the meaning of block/unblock with ready/wait
   in the tranformer state and its related process gadgets classes.
++ Merge [`Complete] indication in Iom_reactor with [`Wait].
 
 ===== Version 0.3 =====
 

File iom/iom_gadget.ml

 
 type input = Nx_poll.more and output = unit
 type work = (input, output) Cf_gadget.work
-type gates = (input, output) Cf_gadget.gates
+type gate = (input, output) Cf_gadget.gate
 type 'a guard = (input, output, 'a) Cf_gadget.guard
 type 'a t = (input, output, 'a) Cf_gadget.t
 
 class ['a] rx e = ['a, input, output] Cf_gadget.rx e
 class ['a] tx e = ['a, input, output] Cf_gadget.tx e
 
-type ('x, 'y) plug = 'x rx * 'y tx
-type ('x, 'y) jack = 'y rx * 'x tx
+type ('x, 'y) pad = 'x rx * 'y tx
+type ('x, 'y) fix = 'y rx * 'x tx
 
 let wire = Cf_gadget.wire
 let wirepair = Cf_gadget.wirepair

File iom/iom_gadget.mli

 (** An functionally compositional unit of scheduling work in a gadget. *)
 type work
 
-(** A sequence of gates produced by the [guard] monad for receiving events in
+(** A gating sequence produced by the [guard] monad for receiving events in
     a gadget using the [guard] function.
 *)
-type gates
+type gate
 
 (** A wire capable of carrying events. *)
 type 'x wire
 *)
 type 'a t = (work, 'a) Cf_cmonad.t
 
-(** A continuation monad for composing [gates], i.e. sequences of wires to
+(** A continuation monad for composing a [gate], i.e. sequences of wires to
     block a gadget when waiting for an event.
 *)
-type 'a guard = (gates, 'a) Cf_cmonad.t
+type 'a guard = (gate, 'a) Cf_cmonad.t
 
 (** {6 Functions and Classes} *)
 
     further processing of the gadget.
     
     Control will never pass to any continuation bound to the result.  Instead,
-    control will pass to the continuation of the first gate in the guard to
-    receive a message.
+    control will pass to the continuation of the first gating wire in the guard
+    to receive a message.
 *)
 val guard: unit guard -> 'a t
 
 val simplex: ('a rx * 'a tx) t
 
 (** A pair of convenience types for representing each end of a bundle of two
-    wires used for duplex communication.  By convention, a plug comprises a
+    wires used for duplex communication.  By convention, a [pad] comprises a
     receiver for control events and a transmitter for notification events, and
-    a jack comprises the transmitter for control events and the receiver for
+    a [fix] comprises the transmitter for control events and the receiver for
     notification events
 *)
-type ('x, 'y) plug = 'x rx * 'y tx
-type ('x, 'y) jack = 'y rx * 'x tx
+type ('x, 'y) pad = 'x rx * 'y tx
+type ('x, 'y) fix = 'y rx * 'x tx
 
 (** Use [connectpair m] to get the pair of wires from [m] and use them to
-    construct a matching jack and plug for a new duplex communication channel.
+    construct a matching [fix] and [pad] for each of them.
 *)
-val connectpair: ('x wire * 'y wire) t -> (('x, 'y) jack * ('x, 'y) plug) t
+val connectpair: ('x wire * 'y wire) t -> (('x, 'y) fix * ('x, 'y) pad) t
 
 (** Use [duplex] to get a pair of wires from the scheduler and use them to
-    construct a matching jack and plug for a new duplex communication channel.
-    This is a convenient abbreviation of [connectpair wirepair].
+    construct a matching [fix] and [pad] for each of them.  This is a
+    convenient abbreviation of [connectpair wirepair].
 *)
-val duplex: (('x, 'y) jack * ('x, 'y) plug) t
+val duplex: (('x, 'y) fix * ('x, 'y) pad) t
 
 (** Use [wrap a b w] to start a new gadget that receives events from the
     receive connector [a], sends event to the transmit connector [b], and
     end
 
 (** Use [create f] to create a duplex channel, and apply [f] to the resulting
-    plug to obtain the initial state of a machine.  The machine is started and
-    the corresponding jack is returned.
+    [pad] to obtain the initial state of a machine.  The machine is started
+    and the corresponding [fix] is returned.
 *)
-val create: (('c, 'n) plug -> #start) -> ('c, 'n) jack t
+val create: (('c, 'n) pad -> #start) -> ('c, 'n) fix t
 
 (** Use [createM f] to create a duplex channel, and apply [f] to the resulting
-    plug to obtain a continuation monad that evaluates to the initial state of
-    a machine.  The machine is started and the corresponding jack is returned.
+    [pad] to obtain a continuation monad that evaluates to the initial state of
+    a machine.  The machine is started and the corresponding [fix] is returned.
 *)
-val createM: (('c, 'n) plug -> #start t) -> ('c, 'n) jack t
+val createM: (('c, 'n) pad -> #start t) -> ('c, 'n) fix t
 
 (** The abstract type of the system I/O event multiplexer. *)
 type kernel

File iom/iom_layer.mli

 
 (** The class of stream gadget state for input stream commutators.  Control
     events are constrained to include flow control signals.  Use [inherit
-    \['xy, 'c, 'n\] isimplex xy jack plug] to derive a state class object that
+    \['xy, 'c, 'n\] isimplex xy fix pad] to derive a state class object that
     delegates stream event flow control to the transform [xy], receives
-    upstream control and sends upstream notifications on [plug], and also sends
-    downstream control and receives downstream notifications on [jack].
+    upstream control and sends upstream notifications on [pad], and also sends
+    downstream control and receives downstream notifications on [fix].
 *)
 class ['xy, 'c, 'n] isimplex:
     'xy -> ('n #Iom_gadget.rx * 'c #Iom_gadget.tx) ->
 
 (** The class of stream gadget state for output stream commutators.
     Notification events are constrained to include flow control signals.  Use
-    [inherit \['xy, 'c, 'n\] osimplex xy jack plug] to derive a state class
+    [inherit \['xy, 'c, 'n\] osimplex xy fix pad] to derive a state class
     object that delegates stream event flow control to the transform [xy],
-    receives upstream control and sends upstream notifications on [plug], and
+    receives upstream control and sends upstream notifications on [pad], and
     also sends downstream control and receives downstream notifications on
-    [jack].
+    [fix].
 *)
 class ['xy, 'c, 'n] osimplex:
     'xy -> ('n #Iom_gadget.rx * 'c #Iom_gadget.tx) ->
 
 (** The class of stream gadget state for full duplex stream commutators.
     Both control and notification events are constrained to include flow
-    control signals.  Use [inherit \['ixy, 'oxy, 'c, 'n\] duplex ixy oxy jack
-    plug] to derive a state class object that delegates stream event flow
+    control signals.  Use [inherit \['ixy, 'oxy, 'c, 'n\] duplex ixy oxy fix
+    pad] to derive a state class object that delegates stream event flow
     control to the input transform [ixy] and the output transform [oxy],
-    receives upstream control and sends upstream notifications on [plug], and
+    receives upstream control and sends upstream notifications on [pad], and
     also sends downstream control and receives downstream notifications on
-    [jack].
+    [fix].
 *)
 class ['ixy, 'oyx, 'c, 'n] duplex:
     'ixy -> 'oyx ->
         method private oblock: unit Iom_gadget.t
     end
 
-(** Use [ingest jack cons] to contruct a harness of wires with a new plug and
-    jack for input streams on its respective ends, apply the appropriate wire
+(** Use [ingest fix cons] to contruct a harness of wires with a new pad and
+    fix for input streams on its respective ends, apply the appropriate wire
     ends (a control event transmitter, an input receiver and an output
     transmitter) to [cons], obtain a stream transform object, and use it to
     construct an [isimplex] object and start the input stream gadget.  The new
-    jack is returned.
+    fix is returned.
 *)
 val ingest:
   ('x, [> Iom_stream.flowcontrol ] as 'c, [> Iom_stream.failed ] as 'n)
-    Iom_stream.ijack ->
+    Iom_stream.ifix ->
   ('c Iom_gadget.tx -> 'x Iom_gadget.rx -> 'y Iom_gadget.tx ->
     ('x, 'y) #transform) ->
-  ('y, 'c, 'n) Iom_stream.ijack Iom_gadget.t
+  ('y, 'c, 'n) Iom_stream.ifix Iom_gadget.t
 
-(** Use [render jack cons] to contruct a harness of wires with a new plug and
-    jack for output streams on its respective ends, apply the appropriate wire
+(** Use [render fix cons] to contruct a harness of wires with a new pad and
+    fix for output streams on its respective ends, apply the appropriate wire
     ends (a notification event transmitter, an input receiver and an output
     transmitter) to [cons], obtain a stream transform object, and use it to
     construct an [osimplex] object and start the output stream gadget.  The new
-    jack is returned.
+    fix is returned.
 *)
 val render:
   ('y, [> Iom_stream.stop ] as 'c, [> Iom_stream.flownotify ] as 'n)
-    Iom_stream.ojack ->
+    Iom_stream.ofix ->
   ('n Iom_gadget.tx -> 'x Iom_gadget.rx -> 'y Iom_gadget.tx ->
     ('x, 'y) #transform) ->
-  ('x, 'c, 'n) Iom_stream.ojack Iom_gadget.t
+  ('x, 'c, 'n) Iom_stream.ofix Iom_gadget.t
 
-(** Use [duplex jack icons ocons] to contruct a harness of wires with a new
-    plug and jack for output streams on its respective ends, apply the
+(** Use [duplex fix icons ocons] to contruct a harness of wires with a new
+    pad and fix for output streams on its respective ends, apply the
     appropriate wire ends to [icons] and [ocons], obtain a pair of stream
     transform objects, and use them to construct an [duplex] object and start
-    the output stream gadget.  The new jack is returned.
+    the output stream gadget.  The new fix is returned.
 *)
 val duplex:
     ('xi, 'xo, [> Iom_stream.flowcontrol ] as 'c,
-        [> Iom_stream.flownotify ] as 'n) Iom_stream.iojack ->
+        [> Iom_stream.flownotify ] as 'n) Iom_stream.iofix ->
     ('c Iom_gadget.tx -> 'xi Iom_gadget.rx -> 'yi Iom_gadget.tx ->
         ('xi, 'yi) #transform) ->
     ('n Iom_gadget.tx -> 'yo Iom_gadget.rx -> 'xo Iom_gadget.tx ->
         ('yo, 'xo) #transform) ->
-    ('yi, 'yo, 'c, 'n) Iom_stream.iojack Iom_gadget.t
+    ('yi, 'yo, 'c, 'n) Iom_stream.iofix Iom_gadget.t
 
 (*--- End of File [ iom_layer.mli ] ---*)

File iom/iom_octet_stream.mli

 
 (** {4 Functions} *)
 
-(** Use [input_buffer ?limits ijack] to apply the buffering discipline to the
-    input stream in [jack] according to [limits].
+(** Use [input_buffer ?limits fix] to apply the buffering discipline to the
+    input stream in [fix] according to [limits].
 *)
 val input_buffer:
-    ?limits:limits -> (fragment, 'c, 'n) Iom_stream.ijack ->
-    (fragment, 'c, 'n) Iom_stream.ijack Iom_gadget.t
+    ?limits:limits -> (fragment, 'c, 'n) Iom_stream.ifix ->
+    (fragment, 'c, 'n) Iom_stream.ifix Iom_gadget.t
 
-(** Use [output_buffer ?limits ojack] to apply the buffering discipline to the
-    output stream in [jack] according to [limits].
+(** Use [output_buffer ?limits fix] to apply the buffering discipline to the
+    output stream in [fix] according to [limits].
 *)
 val output_buffer:
-    ?limits:limits -> (fragment, 'c, 'n) Iom_stream.ojack ->
-    (fragment, 'c, 'n) Iom_stream.ojack Iom_gadget.t
+    ?limits:limits -> (fragment, 'c, 'n) Iom_stream.ofix ->
+    (fragment, 'c, 'n) Iom_stream.ofix Iom_gadget.t
 
-(** Use [duplex_buffers ?limits iojack] to apply the buffering discipline to
-    the output stream in [iojack] according to [ilim] and [olim].
+(** Use [duplex_buffers ?ilim ?olim fix] to apply the buffering discipline to
+    the output stream in [fix] according to [ilim] and [olim].
 *)
 val duplex_buffers:
     ?ilim:limits -> ?olim:limits ->
-    (fragment, fragment, 'c, 'n) Iom_stream.iojack ->
-    (fragment, fragment, 'c, 'n) Iom_stream.iojack Iom_gadget.t
+    (fragment, fragment, 'c, 'n) Iom_stream.iofix ->
+    (fragment, fragment, 'c, 'n) Iom_stream.iofix Iom_gadget.t
 
 (*--- End of File [ iom_octet_stream.mli ] ---*)

File iom/iom_pipe.ml

 
 open Cf_cmonad.Op
 
-class reader ~k ~fd ~limits plug = object
+class reader ~k ~fd ~limits pad = object
     inherit [Iom_stream.flowcontrol, Iom_stream.failed] Iom_reactor.reader
-        ~k ~fd ~limits plug as super
+        ~k ~fd ~limits pad as super
     
     method private fragment =
         if more_ = Iom_stream.Last then Unix.close fd;
         super#fragment
 end
 
-class writer ~k ~fd plug = object
-    inherit [Iom_octet_stream.fragment, Iom_stream.stop, Iom_reactor.notify]
-        Iom_reactor.writer ~k ~fd plug as super
+class writer ~k ~fd pad = object
+    inherit [Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify]
+        Iom_reactor.writer ~k ~fd pad as super
     
     method private complete =
         Unix.close fd;
 
 let create ~limits k =
     let fd0, fd1 = Unix.pipe () in
-    Iom_stream.ijack (new reader ~k ~fd:fd0 ~limits) >>= fun ijack ->
-    Iom_stream.ojack (new writer ~k ~fd:fd1) >>= fun ojack ->
-    Cf_cmonad.return (ijack, ojack)
+    Iom_stream.ifix (new reader ~k ~fd:fd0 ~limits) >>= fun ifix ->
+    Iom_stream.ofix (new writer ~k ~fd:fd1) >>= fun ofix ->
+    Cf_cmonad.return (ifix, ofix)
 
 (*--- End of File [ iom_pipe.ml ] ---*)

File iom/iom_pipe.mli

     k:Iom_gadget.kernel -> fd:Unix.file_descr ->
     limits:Iom_octet_stream.limits ->
     (Iom_octet_stream.fragment, Iom_stream.flowcontrol, Iom_stream.failed)
-        Iom_stream.iplug ->
+        Iom_stream.ipad ->
     [Iom_stream.flowcontrol, Iom_stream.failed] Iom_reactor.reader
 
 (** A gadget for writing to a pipe. *)
 class writer:
     k:Iom_gadget.kernel -> fd:Unix.file_descr ->
-    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_reactor.notify)
-        Iom_stream.oplug ->
-    [Iom_octet_stream.fragment, Iom_stream.stop, Iom_reactor.notify]
+    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify)
+        Iom_stream.opad ->
+    [Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify]
         Iom_reactor.writer
 
-(** Evaluate [create ~limits k] to obtain the reader and writer jacks for the
+(** Evaluate [create ~limits k] to obtain the reader and writer fixes for the
     I/O stream gadgets connected to each end of a new pipe.
 *)
 val create:
     limits:Iom_octet_stream.limits -> Iom_gadget.kernel ->
-    (Iom_reactor.reader_jack * Iom_reactor.writer_jack) Iom_gadget.t
+    (Iom_reactor.reader_fix * Iom_reactor.writer_fix) Iom_gadget.t
 
 (*--- End of File [ iom_pipe.mli ] ---*)

File iom/iom_reactor.ml

 type idle = [ `Idle of Cf_tai64n.t ]
 type time = [ `Time of Cf_tai64n.t ]
 
-type complete = [ `Complete ]
-type notify = [ Iom_stream.flownotify | complete ]
-
-type ('c, 'n) signaler_jack = ('c, 'n) Iom_gadget.jack
+type ('c, 'n) signaler_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> signal ]
 
-type ('c, 'n) idler_jack = ('c, 'n) Iom_gadget.jack
+type ('c, 'n) idler_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> idle ]
 
-type ('c, 'n) timer_jack = ('c, 'n) Iom_gadget.jack
+type ('c, 'n) timer_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> time ]
 
-type reader_jack =
+type reader_fix =
     (Iom_octet_stream.fragment, Iom_stream.flowcontrol, Iom_stream.failed)
-    Iom_stream.ijack
+    Iom_stream.ifix
 
-type writer_jack =
-    (Iom_octet_stream.fragment, Iom_stream.stop, notify) Iom_stream.ojack
+type writer_fix =
+    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ofix
 
 class virtual ['control] core controlRx =
     let controlRx = (controlRx : 'control Iom_gadget.rx) in
             super#start
     end
 
-class virtual ['control, 'source] source ~k:kernel plug =
-    let plug = (plug : ('control, 'source) Iom_gadget.plug) in
-    let controlRx, sourceTx = plug in
+class virtual ['control, 'source] source ~k:kernel pad =
+    let pad = (pad : ('control, 'source) Iom_gadget.pad) in
+    let controlRx, sourceTx = pad in
     object(self:'self)
         inherit ['control] core controlRx as super
         constraint 'control = [> Iom_stream.flowcontrol ]
             | c -> super#control c
     end
 
-class ['control, 'signal] signaler ~k ~n plug = object
-    inherit ['control, 'signal] source ~k plug
+class ['control, 'signal] signaler ~k ~n pad = object
+    inherit ['control, 'signal] source ~k pad
     inherit [unit Iom_gadget.t] Nx_poll.signal n
     constraint 'signal = [> signal ]
     method private source = Some (`Signal n)
 end
 
-class ['control, 'idle] idler ~k plug = object
-    inherit ['control, 'idle] source ~k plug
+class ['control, 'idle] idler ~k pad = object
+    inherit ['control, 'idle] source ~k pad
     inherit [unit Iom_gadget.t] Nx_poll.idle
     constraint 'idle = [> idle ]
     
         | None -> None
 end
 
-class ['control, 'time] timer ~k ?t0 ~dt plug = object
-    inherit ['control, 'signal] source ~k plug as super
+class ['control, 'time] timer ~k ?t0 ~dt pad = object
+    inherit ['control, 'signal] source ~k pad as super
     inherit [unit Iom_gadget.t] Nx_poll.time ?t0 dt
     constraint 'time = [> time ]
     
         false
 
 class virtual ['fragment, 'control, 'notify] reader_aux
-    ~k ?(rwx: Nx_poll.rwx = `R) ~fd ~limits plug =
+    ~k ?(rwx: Nx_poll.rwx = `R) ~fd ~limits pad =
     let limits = Iom_octet_stream.normalize_limits limits in
-    let fragmentTx, (controlRx, notifyTx) = plug in
+    let fragmentTx, (controlRx, notifyTx) = pad in
     let notifyTx = (notifyTx : 'notify Iom_gadget.tx) in
-    let plug = (controlRx, fragmentTx) in
+    let pad = (controlRx, fragmentTx) in
     object(self:'self)
-        inherit ['control, 'fragment] source ~k plug as source
+        inherit ['control, 'fragment] source ~k pad as source
         inherit [unit Iom_gadget.t] Nx_poll.file rwx fd as poll
 
         constraint 'fragment = #Iom_octet_stream.fragment
             cons_ <- Lazy.lazy_from_val f
     end
 
-class ['control, 'notify] reader ~k ?rwx ~fd ~limits plug =
+class ['control, 'notify] reader ~k ?rwx ~fd ~limits pad =
     object
         inherit [Iom_octet_stream.fragment, 'control, 'notify] reader_aux
-            ~k ~limits ?rwx ~fd plug
+            ~k ~limits ?rwx ~fd pad
         
         method private fragment = new Iom_octet_stream.fragment more_ stack_
     end
 
-let reader ~fd ~limits k = Iom_stream.ijack (new reader ~k ~fd ~limits)
+let reader ~fd ~limits k = Iom_stream.ifix (new reader ~k ~fd ~limits)
 
-class ['fragment, 'control, 'notify] writer ~k:kernel ~fd plug =
-    let fragmentRx, (controlRx, notifyTx) = plug in
+class ['fragment, 'control, 'notify] writer ~k:kernel ~fd pad =
+    let fragmentRx, (controlRx, notifyTx) = pad in
     let fragmentRx = (fragmentRx : 'fragment Iom_gadget.rx) in
     let notifyTx = (notifyTx : 'notify Iom_gadget.tx) in
     object(self:'self)
         inherit [unit Iom_gadget.t] Nx_poll.file `W fd as poll
 
         constraint 'fragment = #Iom_octet_stream.fragment
-        constraint 'notify = [> notify ]
+        constraint 'notify = [> Iom_stream.flownotify ]
         
         val mutable buffer_ = Cf_deque.nil
         val mutable more_ = Iom_stream.More
             notifyTx#put (`Failed x) >>= fun () ->
             self#stop
     
-        method private complete = notifyTx#put `Complete
+        method private complete = notifyTx#put `Wait
 
         method private octets buf pos len = Unix.write fd buf pos len
         
                 self#fail x
     end
 
-let writer ~fd k = Iom_stream.ojack (new writer ~k ~fd)
+let writer ~fd k = Iom_stream.ofix (new writer ~k ~fd)
 
 (*--- End of File [ iom_reactor.ml ] ---*)

File iom/iom_reactor.mli

 (** Timer event. *)
 type time = [ `Time of Cf_tai64n.t ]
 
-(** Writer sent end of octet stream. *)
-type complete = [ `Complete ]
-
-(** Writer notifications. *)
-type notify = [ Iom_stream.flownotify | complete ]
-
 (** {6 Jacks} *)
 
-(** The jack for process signal reactors. *)
-type ('c, 'n) signaler_jack = ('c, 'n) Iom_gadget.jack
+(** The fix for process signal reactors. *)
+type ('c, 'n) signaler_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> signal ]
 
-(** The jack for loop idle reactors. *)
-type ('c, 'n) idler_jack = ('c, 'n) Iom_gadget.jack
+(** The fix for loop idle reactors. *)
+type ('c, 'n) idler_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> idle ]
 
-(** The jack for timer event reactors. *)
-type ('c, 'n) timer_jack = ('c, 'n) Iom_gadget.jack
+(** The fix for timer event reactors. *)
+type ('c, 'n) timer_fix = ('c, 'n) Iom_gadget.fix
     constraint 'c = [> Iom_stream.flowcontrol ]
     constraint 'n = [> time ]
 
-(** A jack for reader reactors. *)
-type reader_jack =
+(** A fix for reader reactors. *)
+type reader_fix =
     (Iom_octet_stream.fragment, Iom_stream.flowcontrol, Iom_stream.failed)
-    Iom_stream.ijack
+    Iom_stream.ifix
 
-(** A jack for writer reactors. *)
-type writer_jack =
-    (Iom_octet_stream.fragment, Iom_stream.stop, notify) Iom_stream.ojack
+(** A fix for writer reactors. *)
+type writer_fix =
+    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ofix
 
 (** {6 Functions}
 
     A simplified functional interface to the reactors.
 *)
 
-(** Evaluate [signaler ~n k] to obtain the signaler jack for a new reactor on
+(** Evaluate [signaler ~n k] to obtain the signaler fix for a new reactor on
     the process signal [n] in the kernel context [k].
 **)
-val signaler: n:int -> Iom_gadget.kernel -> ('c, 'n) signaler_jack Iom_gadget.t
+val signaler: n:int -> Iom_gadget.kernel -> ('c, 'n) signaler_fix Iom_gadget.t
 
-(** Evaluate [idler k] to obtain the idler jack for a new reactor on loop idle
+(** Evaluate [idler k] to obtain the idler fix for a new reactor on loop idle
     events in the kernel context [k].
 *)
-val idler: Iom_gadget.kernel -> ('c, 'n) idler_jack Iom_gadget.t
+val idler: Iom_gadget.kernel -> ('c, 'n) idler_fix Iom_gadget.t
 
-(** Evaluate [timer ?t0 ~dt k] to obtain the timer jack for a new reactor on
+(** Evaluate [timer ?t0 ~dt k] to obtain the timer fix for a new reactor on
     timer events in the kernel context [k] that fire every [dt] seconds.
     Use the optional [t0] parameter to specify the time of the first event.
 *)
 val timer:
     ?t0:Cf_tai64n.t -> dt:float -> Iom_gadget.kernel ->
-    ('c, 'n) timer_jack Iom_gadget.t
+    ('c, 'n) timer_fix Iom_gadget.t
 
-(** Evaluate [reader ~fd ~limits k] to obtain the reader jack for a new reactor
+(** Evaluate [reader ~fd ~limits k] to obtain the reader fix for a new reactor
     on read events for the file descriptor [fd] in the kernel context [k] with
     [limits] on the buffering parameters.
 *)
 val reader:
     fd:Unix.file_descr -> limits:Iom_octet_stream.limits -> 
-    Iom_gadget.kernel -> reader_jack Iom_gadget.t
+    Iom_gadget.kernel -> reader_fix Iom_gadget.t
 
-(** Evaluate [writer ~fd k] to obtain the writer jack for a new reactor on
+(** Evaluate [writer ~fd k] to obtain the writer fix for a new reactor on
     write events for the file descriptor [fd] in the kernel context [k].
 *)
-val writer: fd:Unix.file_descr -> Iom_gadget.kernel -> writer_jack Iom_gadget.t
+val writer: fd:Unix.file_descr -> Iom_gadget.kernel -> writer_fix Iom_gadget.t
 
 (** Use [retry_needed error] to test whether [error] is either [Unix.EAGAIN] or
     [Unix.EWOULDBLOCK].
     events and flow control.
 *)
 class virtual ['control, 'source] source:
-    k:Iom_gadget.kernel -> ('control, 'source) Iom_gadget.plug ->
+    k:Iom_gadget.kernel -> ('control, 'source) Iom_gadget.pad ->
     object('self)
         inherit ['control] core
         constraint 'control = [> Iom_stream.flowcontrol ]
 
 (** A stream gadget that responds to process signals. *)
 class ['control, 'signal] signaler:
-    k:Iom_gadget.kernel -> n:int -> ('control, 'signal) Iom_gadget.plug ->
+    k:Iom_gadget.kernel -> n:int -> ('control, 'signal) Iom_gadget.pad ->
     object
         inherit ['control, 'signal] source
         inherit [unit Iom_gadget.t] Nx_poll.signal
 
 (** A stream gadget that responds to loop idle events. *)
 class ['control, 'idle] idler:
-    k:Iom_gadget.kernel -> ('control, 'idle) Iom_gadget.plug ->
+    k:Iom_gadget.kernel -> ('control, 'idle) Iom_gadget.pad ->
     object
         inherit ['control, 'idle] source
         inherit [unit Iom_gadget.t] Nx_poll.idle
 (** A stream gadget that responds to timer events. *)
 class ['control, 'time] timer:
     k:Iom_gadget.kernel -> ?t0:Cf_tai64n.t -> dt:float ->
-    ('control, 'time) Iom_gadget.plug ->
+    ('control, 'time) Iom_gadget.pad ->
     object
         inherit ['control, 'time] source
         inherit [unit Iom_gadget.t] Nx_poll.time
 class virtual ['fragment, 'control, 'notify] reader_aux:
     k:Iom_gadget.kernel ->  ?rwx:Nx_poll.rwx -> fd:Unix.file_descr ->
     limits:Iom_octet_stream.limits ->
-    ('fragment, 'control, 'notify) Iom_stream.iplug ->
+    ('fragment, 'control, 'notify) Iom_stream.ipad ->
     object('self)
         inherit ['control, 'fragment] source
         inherit [unit Iom_gadget.t] Nx_poll.file
 class ['control, 'notify] reader:
     k:Iom_gadget.kernel -> ?rwx:Nx_poll.rwx -> fd:Unix.file_descr ->
     limits:Iom_octet_stream.limits ->
-    (Iom_octet_stream.fragment, 'control, 'notify) Iom_stream.iplug ->
+    (Iom_octet_stream.fragment, 'control, 'notify) Iom_stream.ipad ->
     object
         inherit [Iom_octet_stream.fragment, 'control, 'notify] reader_aux
         
 (** A stream gadget that writes octet stream fragments with [Unix.write]. *)
 class ['fragment, 'control, 'notify] writer:
     k:Iom_gadget.kernel -> fd:Unix.file_descr ->
-    ('fragment, 'control, 'notify) Iom_stream.oplug ->
+    ('fragment, 'control, 'notify) Iom_stream.opad ->
     object('self)
         inherit ['control] core
         inherit [unit Iom_gadget.t] Nx_poll.file
 
-        constraint 'notify = [> notify ]
+        constraint 'notify = [> Iom_stream.flownotify ]
         constraint 'fragment = #Iom_octet_stream.fragment
         
         (** The queue of substrings pending for write. *)
         *)
         method private fail: 'a. exn -> 'a Iom_gadget.t
         
-        (** Use [self#complete] to send the [`Complete] notification.  Derived
-            classes may need to override.
+        (** Use [self#complete] to send the [`Wait] notification when the last
+            octet has been written to the stream.  Derived classes may need to
+            override.
         *)
         method private complete: unit Iom_gadget.t
         

File iom/iom_sock_stream.ml

     method socket: ('af, [ `SOCK_STREAM ]) Nx_socket.t = socket
 end
 
-class virtual ['control, 'notify, 'connect] connector ~k ~s:socket ~rwx plug =
+class virtual ['control, 'notify, 'connect] connector ~k ~s:socket ~rwx pad =
     let _ = (socket : 'socket) in
     let fd = Nx_socket.to_unix_file_descr socket in
-    let connectTx, (controlRx, notifyTx) = plug in
+    let connectTx, (controlRx, notifyTx) = pad in
     let notifyTx = (notifyTx : 'notify Iom_gadget.tx) in
-    let plug = (controlRx, connectTx) in
+    let pad = (controlRx, connectTx) in
     object(self:'self)
-        inherit ['control, 'connect] Iom_reactor.source ~k plug as super
+        inherit ['control, 'connect] Iom_reactor.source ~k pad as super
         inherit [unit Iom_gadget.t] Nx_poll.file rwx fd as poll
 
         constraint 'socket = ('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t
                 self#fail x
     end
 
-class virtual ['control, 'notify, 'connect] initiator ~k ~s plug =
-    let connectTx, _ = plug in
+class virtual ['control, 'notify, 'connect] initiator ~k ~s pad =
+    let connectTx, _ = pad in
     object(self:'self)
         inherit ['control, 'notify, 'connect] connector
-            ~k ~s ~rwx:`W plug as super
+            ~k ~s ~rwx:`W pad as super
                 
         method virtual private connect: 'connect
         
     let tx = (tx :> 'a Iom_gadget.tx) in
     Cf_seq.C.sequence (Cf_seq.map tx#put (Cf_seq.of_list (List.rev acc)))
 
-class virtual ['control, 'notify, 'connect] listener ~k ~s ~backlog plug =
-    let connectTx, (_, notifyTx) = plug in
+class virtual ['control, 'notify, 'connect] listener ~k ~s ~backlog pad =
+    let connectTx, (_, notifyTx) = pad in
     object(self:'self)
         inherit ['control, 'notify, 'connect] connector
-            ~k ~s ~rwx:`R plug as super
+            ~k ~s ~rwx:`R pad as super
 
         constraint 'notify = [> 'address listener_notify ]
         
                     self#fail x
     end
 
-class ['control, 'notify] receiver ~k ~s:socket ~limits plug =
+class ['control, 'notify] receiver ~k ~s:socket ~limits pad =
     let _ = (socket : ('af, [ `SOCK_STREAM ]) Nx_socket.t) in
     let fd = Nx_socket.to_unix_file_descr socket in
-    let fragmentTx, (_, notifyTx) = plug in
+    let fragmentTx, (_, notifyTx) = pad in
     object(self)
-        inherit ['control, 'notify] Iom_reactor.reader ~k ~fd ~limits plug
+        inherit ['control, 'notify] Iom_reactor.reader ~k ~fd ~limits pad
 
         method private octets n =
             let v =
                     | Iom_stream.More ->
                         Nx_poll.Working (p, out)
                     | Iom_stream.Last ->
-                        let out = out >>= fun () -> notifyTx#put `Complete in
+                        let out = out >>= fun () -> notifyTx#put `Finished in
                         Nx_poll.Final out
             with
             | Unix.Unix_error (code, _, _)
                 Nx_poll.Final (notifyTx#put (`Failed x))
     end
 
-class ['control, 'notify] sender ~k ~s:socket plug =
+class ['control, 'notify] sender ~k ~s:socket pad =
     let _ = (socket : ('af, [ `SOCK_STREAM ]) Nx_socket.t) in
     let fd = Nx_socket.to_unix_file_descr socket in
     object
+        constraint 'notify = [> `Finished ]
+        
         inherit [Iom_octet_stream.fragment, 'control, 'notify]
-            Iom_reactor.writer ~k ~fd plug as super
+            Iom_reactor.writer ~k ~fd pad as super
         
         method private octets buf pos len =
             Nx_socket.send socket buf pos len Nx_socket.msg_flags_none
 
 type ('ci, 'co, 'ni, 'no, 'x, 'cx, 'nx) state = [
     | ('ci, 'co, 'ni, 'no) Iom_socket.state
-    | `S_receiving of ('ci, 'ni) Iom_gadget.jack
-    | `S_sending of ('co, 'no) Iom_gadget.jack
-    | `S_initiating of ('x, 'cx, 'nx) Iom_stream.ijack * 'ci
+    | `S_receiving of ('ci, 'ni) Iom_gadget.fix
+    | `S_sending of ('co, 'no) Iom_gadget.fix
+    | `S_initiating of ('x, 'cx, 'nx) Iom_stream.ifix * 'ci
 ]
-constraint 'ni = [> Iom_reactor.complete ]
+constraint 'ni = [> `Finished ]
+constraint 'no = [> `Finished ]
 
-class virtual ['i, 'o, 'control, 'notify, 'af] endpoint ~k ~s ?addrs plug =
-    let _, (_, notifyTx) = plug in
+class virtual ['i, 'o, 'control, 'notify, 'af] endpoint ~k ~s ?addrs pad =
+    let _, (_, notifyTx) = pad in
     object(self:'self)
         inherit ['i, 'o, 'control, 'notify, 'state, 'af, 'st]
-            Iom_socket.endpoint ~k ~s plug as super
+            Iom_socket.endpoint ~k ~s pad as super
 
         constraint 'i = #Iom_octet_stream.fragment
         constraint 'o = #Iom_octet_stream.fragment
 
         method virtual private initiator:
             src:'af Nx_socket.sockaddr -> dst:'af Nx_socket.sockaddr ->
-            ('x, 'cx, 'nx) Iom_stream.iplug -> #Iom_gadget.start
+            ('x, 'cx, 'nx) Iom_stream.ipad -> #Iom_gadget.start
         
         method private state0 =
             match addrs with
         
         method private inotify c =
             match c, state_ with
-            | `Complete, `S_established (_, wr) ->
+            | `Finished, `S_established (_, wr) ->
                 {< state_ = `S_sending wr >}#next
-            | `Complete, `S_receiving _ ->
+            | `Finished, `S_receiving _ ->
                 self#close
             | _ ->
                 super#inotify c
 
         method private onotify c =
             match c, state_ with
-            | `Complete as c, `S_established (rd, _) ->
-                notifyTx#put c >>= fun () ->
+            | `Finished, `S_established (rd, _) ->
+                notifyTx#put `Wait >>= fun () ->
                 {< state_ = `S_receiving rd >}#next
-            | `Complete as c, `S_sending _ ->
-                notifyTx#put c >>= fun () ->
+            | `Finished, `S_sending _ ->
+                notifyTx#put `Wait >>= fun () ->
                 self#close
             | _ ->
                 super#onotify c
     class ['af] connection_aux = ['af] connection
     
     class virtual ['control, 'notify, 'connect] initiator_aux
-        ~k ~s ~src ~dst plug =
+        ~k ~s ~src ~dst pad =
         object(self)
-            inherit ['control, 'notify, 'connect] initiator ~k ~s plug
+            inherit ['control, 'notify, 'connect] initiator ~k ~s pad
             constraint 'connect = 'af #connection_aux
         
             method virtual private aux:
         end
     
     class virtual ['control, 'notify, 'connect] listener_aux
-        ~k ~s ~src ~backlog plug =
+        ~k ~s ~src ~backlog pad =
         object(self)
-            inherit ['control, 'notify, 'connect] listener ~k ~s ~backlog plug
+            inherit ['control, 'notify, 'connect] listener ~k ~s ~backlog pad
             constraint 'connect = 'af #connection_aux
 
             method virtual private aux:
         ['i, 'o, 'control, 'notify, 'af] endpoint
 end
 
-type endpoint_jack =
+type endpoint_fix =
     (Iom_octet_stream.fragment, Iom_octet_stream.fragment,
-    Iom_stream.flowcontrol, Iom_reactor.notify) Iom_stream.iojack
+    Iom_stream.flowcontrol, Iom_stream.flownotify) Iom_stream.iofix
 
-type 'af initiator_jack =
+type 'af initiator_fix =
     ('af connection, Iom_stream.flowcontrol, Iom_stream.failed)
-    Iom_stream.ijack
+    Iom_stream.ifix
 
-type 'af listener_jack =
+type 'af listener_fix =
     ('af connection, Iom_stream.flowcontrol, 'af Nx_socket.sockaddr
-    listener_notify) Iom_stream.ijack
+    listener_notify) Iom_stream.ifix
 
-class ['af] initiator0 ~k ~s ~src ~dst plug = object
+class ['af] initiator0 ~k ~s ~src ~dst pad = object
     inherit [Iom_stream.flowcontrol, Iom_stream.failed, 'af connection]
-        Aux.initiator_aux ~k ~s ~src ~dst plug
+        Aux.initiator_aux ~k ~s ~src ~dst pad
     
     method private aux s = new connection Iom_stream.Last s
 end
 
 let initiator ~s ~src ~dst k =
-    Iom_stream.ijack (new initiator0 ~k ~s ~src ~dst)
+    Iom_stream.ifix (new initiator0 ~k ~s ~src ~dst)
 
-class ['af] listener0 ~k ~s ~src ~backlog plug = object
+class ['af] listener0 ~k ~s ~src ~backlog pad = object
     inherit [Iom_stream.flowcontrol, 'af Nx_socket.sockaddr listener_notify,
-        'af connection] Aux.listener_aux ~k ~s ~backlog ~src plug
+        'af connection] Aux.listener_aux ~k ~s ~backlog ~src pad
         
     method getsockname = Nx_socket.getsockname s
     method private aux s = new connection Iom_stream.More s
 end
 
 let listener ~s ~src ~backlog k =
-    Iom_stream.ijack (new listener0 ~k ~s ~src ~backlog)
+    Iom_stream.ifix (new listener0 ~k ~s ~src ~backlog)
 
-class ['af] endpoint0 ~k ~s ?addrs ~limits plug = object
+class ['af] endpoint0 ~k ~s ?addrs ~limits pad = object
     inherit [Iom_octet_stream.fragment, Iom_octet_stream.fragment,
-        Iom_stream.flowcontrol, Iom_reactor.notify, 'af] endpoint ~k ~s ?addrs
-        plug
+        Iom_stream.flowcontrol, Iom_stream.flownotify, 'af] endpoint ~k ~s
+        ?addrs pad
 
     method private initiator = new initiator0 ~k ~s
     method private sender = new sender ~k ~s
 end
 
 let endpoint ~s ?addrs ~limits k =
-    Iom_stream.iojack (new endpoint0 ~k ~s ?addrs ~limits)
+    Iom_stream.iofix (new endpoint0 ~k ~s ?addrs ~limits)
 
 module type T = sig
     include Iom_socket.T with module P.ST = Nx_socket.SOCK_STREAM
     end
 
     type initiator =
-        (connection, Iom_stream.flowcontrol, Iom_stream.failed)
-        Iom_stream.ijack
+        (connection, Iom_stream.flowcontrol, Iom_stream.failed) Iom_stream.ifix
 
     type listener =
         (connection, Iom_stream.flowcontrol, address listener_notify)
-        Iom_stream.ijack
+        Iom_stream.ifix
     
-    type endpoint = endpoint_jack
+    type endpoint = endpoint_fix
     
     val socket: unit -> t
 
         end
 
     type initiator =
-        (connection, Iom_stream.flowcontrol, Iom_stream.failed)
-        Iom_stream.ijack
+        (connection, Iom_stream.flowcontrol, Iom_stream.failed) Iom_stream.ifix
 
     type listener =
         (connection, Iom_stream.flowcontrol, address listener_notify)
-        Iom_stream.ijack
+        Iom_stream.ifix
     
-    type endpoint = endpoint_jack
+    type endpoint = endpoint_fix
     
     let socket () = 
         (Nx_socket.create P.AF.domain P.ST.socktype P.protocol : t)
             let dst = P.AF.to_sockaddr dst in
             Some (src, dst)
 
-    class initiator0 ~k ?(s = socket ()) ?(src = unspecified_address)
-        ~dst plug =
+    class initiator0
+      ~k ?(s = socket ()) ?(src = unspecified_address) ~dst pad =
         let src = P.AF.to_sockaddr src in
         let dst = P.AF.to_sockaddr dst in
         object
             inherit [Iom_stream.flowcontrol, Iom_stream.failed, connection]
-                Aux.initiator_aux ~k ~s ~src ~dst plug
+                Aux.initiator_aux ~k ~s ~src ~dst pad
             
             method private aux s = new connection Iom_stream.Last s
         end
 
     let initiator ?s ?src ~dst k =
-        Iom_stream.ijack (new initiator0 ~k ?s ?src ~dst)
+        Iom_stream.ifix (new initiator0 ~k ?s ?src ~dst)
 
-    class listener0 ~k ?(s = socket ()) ?(src = unspecified_address) ~backlog
-      plug =
+    class listener0
+      ~k ?(s = socket ()) ?(src = unspecified_address) ~backlog pad =
         let src = P.AF.to_sockaddr src in
         object
             inherit [Iom_stream.flowcontrol, 'address listener_notify,
-                connection] Aux.listener_aux ~k ~s ~backlog ~src plug
+                connection] Aux.listener_aux ~k ~s ~backlog ~src pad
                 
             method getsockname = P.AF.of_sockaddr (Nx_socket.getsockname s)
             method private aux s = new connection Iom_stream.More s
         end
 
     let listener ?s ?src ~backlog k =
-        Iom_stream.ijack (new listener0 ~k ?s ?src ~backlog)
+        Iom_stream.ifix (new listener0 ~k ?s ?src ~backlog)
 
-    class endpoint0 ~k ?(s = socket ()) ?addrs ~limits plug =
+    class endpoint0 ~k ?(s = socket ()) ?addrs ~limits pad =
         let addrs = addrsoptmap_ addrs in
         object
             inherit [Iom_octet_stream.fragment, Iom_octet_stream.fragment,
-                Iom_stream.flowcontrol, Iom_reactor.notify, P.AF.tag] endpoint
-                ~k ~s ?addrs plug
+                Iom_stream.flowcontrol, Iom_stream.flownotify, P.AF.tag]
+                endpoint ~k ~s ?addrs pad
 
             method private initiator ~src ~dst =
                 let src = P.AF.of_sockaddr src in
         end
 
     let endpoint ?s ?addrs ~limits k =
-        Iom_stream.iojack (new endpoint0 ~k ?s ?addrs ~limits)
+        Iom_stream.iofix (new endpoint0 ~k ?s ?addrs ~limits)
 end
 
 (*--- End of File [ iom_sock_stream.ml ] ---*)

File iom/iom_sock_stream.mli

 
 (** {6 Simplified Functional Interface} *)
 
-(** The jack for controlling a socket. *)
-type endpoint_jack =
+(** The fix for controlling a socket. *)
+type endpoint_fix =
     (Iom_octet_stream.fragment, Iom_octet_stream.fragment,
-        Iom_stream.flowcontrol, Iom_reactor.notify) Iom_stream.iojack
+        Iom_stream.flowcontrol, Iom_stream.flownotify) Iom_stream.iofix
 
-(** The jack for controlling a connection initiator. *)
-type 'af initiator_jack =
+(** The fix for controlling a connection initiator. *)
+type 'af initiator_fix =
     ('af connection, Iom_stream.flowcontrol, Iom_stream.failed)
-        Iom_stream.ijack
+        Iom_stream.ifix
 
-(** The jack for controlling a listener. *)
-type 'af listener_jack =
+(** The fix for controlling a listener. *)
+type 'af listener_fix =
     ('af connection, Iom_stream.flowcontrol, 'af Nx_socket.sockaddr
-    listener_notify) Iom_stream.ijack
+    listener_notify) Iom_stream.ifix
 
-(** Evaluate [initiator ~s ~src ~dst k] to obtain the initiator jack for
+(** Evaluate [initiator ~s ~src ~dst k] to obtain the initiator fix for
     binding the socket [s] to the local address [src] and connecting it in the
     kernel context [k] to the destination address [dst].
 *)
 val initiator:
     s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
     src:'af Nx_socket.sockaddr -> dst:'af Nx_socket.sockaddr ->
-    Iom_gadget.kernel -> 'af initiator_jack Iom_gadget.t
+    Iom_gadget.kernel -> 'af initiator_fix Iom_gadget.t
 
-(** Evaluate [listener ~s ~src ~backlog k] to obtain the listener jack for
+(** Evaluate [listener ~s ~src ~backlog k] to obtain the listener fix for
     binding the socket [s] to the local address [src], applying a listen queue
     depth of [backlog] and accepting connections in the kernel context [k].
 *)
 val listener:
     s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t -> 
     src:'af Nx_socket.sockaddr -> backlog:int -> Iom_gadget.kernel ->
-    'af listener_jack Iom_gadget.t
+    'af listener_fix Iom_gadget.t
 
-(** Evaluate [endpoint ~s ?addrs ~limits k] to obtain the endpoint jack for
+(** Evaluate [endpoint ~s ?addrs ~limits k] to obtain the endpoint fix for
     the socket [s].  If [~addrs] is provided, then bind the socket to the
     first address and connect to the second address before notifying ready to
     send.
     s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
     ?addrs:('af Nx_socket.sockaddr * 'af Nx_socket.sockaddr) ->
     limits:Iom_octet_stream.limits -> Iom_gadget.kernel ->
-    endpoint_jack Iom_gadget.t
+    endpoint_fix Iom_gadget.t
 
 (** {6 Signaling Connection} *)
 
-(** Use [inherit connector ~k ~s ~rwx plug] to derive a subclass gadget that
+(** Use [inherit connector ~k ~s ~rwx pad] to derive a subclass gadget that
     responds to connection events on the socket [s] in the kernel context [k].
     The [rwx] parameter identifies the sort of {!Nx_poll.file} required.  The
     base class inherits from {!Iom_reactor.source} and {!Nx_poll.file}.
 *)
 class virtual ['control, 'notify, 'connect] connector:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
-    rwx:[< Nx_poll.rwx ] -> ('connect, 'control, 'notify) Iom_stream.iplug ->
+    rwx:[< Nx_poll.rwx ] -> ('connect, 'control, 'notify) Iom_stream.ipad ->
     object
         inherit ['control, 'connect] Iom_reactor.source
         inherit [unit Iom_gadget.t] Nx_poll.file
         method private fail: 'a. exn -> 'a Iom_gadget.t
     end
 
-(** Use [inherit \['control, 'notify, 'connect\] initiator ~k ~s plug] to
+(** Use [inherit \['control, 'notify, 'connect\] initiator ~k ~s pad] to
     derive a subclass for a gadget that initiates a connection to a remote
     address in the kernel context [k] with the socket [s].
 *)
 class virtual ['control, 'notify, 'connect] initiator:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
-    ('connect, 'control, 'notify) Iom_stream.iplug ->
+    ('connect, 'control, 'notify) Iom_stream.ipad ->
     object
         inherit ['control, 'notify, 'connect] connector
         constraint 'connect = 'af #connection
         method private source: 'connect option
     end
 
-(** Use [inherit \['control, 'notify, 'connect\] listener ~k ~s ~backlog plug]
+(** Use [inherit \['control, 'notify, 'connect\] listener ~k ~s ~backlog pad]
     to derive a subclass for a gadget that listens for connections at a local
     address in the kernel context [k] with the socket [s].
 *)
 class virtual ['control, 'notify, 'connect] listener:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
-    backlog:int -> ('connect, 'control, 'notify) Iom_stream.iplug ->
+    backlog:int -> ('connect, 'control, 'notify) Iom_stream.ipad ->
     object
         inherit ['control, 'notify, 'connect] connector
         constraint 'connect = 'af #connection
 class ['control, 'notify] receiver:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
     limits:Iom_octet_stream.limits ->
-    (Iom_octet_stream.fragment, 'control, 'notify) Iom_stream.iplug ->
-    ['control, [> Iom_reactor.complete ] as 'notify] Iom_reactor.reader
+    (Iom_octet_stream.fragment, 'control, [> `Finished ] as 'notify)
+        Iom_stream.ipad ->
+    ['control, 'notify] Iom_reactor.reader
 
 (** A sender gadget for stream socket output. *)
 class ['control, 'notify] sender:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
-    (Iom_octet_stream.fragment, 'control, 'notify) Iom_stream.oplug ->
+    (Iom_octet_stream.fragment, 'control, [> `Finished ] as 'notify)
+        Iom_stream.opad ->
     [Iom_octet_stream.fragment, 'control, 'notify] Iom_reactor.writer
 
 (** The endpoint control state for stream socket gadgets.  Extends the core
     | ('ci, 'co, 'ni, 'no) Iom_socket.state
     
     (** Socket is receiving only.  Sender has stopped. *)
-    | `S_receiving of ('ci, 'ni) Iom_gadget.jack
+    | `S_receiving of ('ci, 'ni) Iom_gadget.fix
     
     (** Socket is sending only.  Receiver has stopped. *)
-    | `S_sending of ('co, 'no) Iom_gadget.jack
+    | `S_sending of ('co, 'no) Iom_gadget.fix
     
     (** Socket is initiating a connection. *)
-    | `S_initiating of ('x, 'cx, 'nx) Iom_stream.ijack * 'ci
+    | `S_initiating of ('x, 'cx, 'nx) Iom_stream.ifix * 'ci
 ]
-constraint 'ni = [> Iom_reactor.complete ]
+constraint 'ni = [> `Finished ]
+constraint 'no = [> `Finished ]
 
-(** Use [inherit \['i, 'o, 'control, 'notify, 'af\] endpoint ~k ~s ?addrs plug]
+(** Use [inherit \['i, 'o, 'control, 'notify, 'af\] endpoint ~k ~s ?addrs pad]
     to derive an endpoint controller gadget for stream sockets specialized by
     the socket address family.
 *)
 class virtual ['i, 'o, 'control, 'notify, 'af] endpoint:
     k:Iom_gadget.kernel -> s:('af, Nx_socket.SOCK_STREAM.tag) Nx_socket.t ->
     ?addrs:('af Nx_socket.sockaddr * 'af Nx_socket.sockaddr) ->
-    ('i, 'o, 'control, 'notify) Iom_stream.ioplug ->
+    ('i, 'o, 'control, 'notify) Iom_stream.iopad ->
     object
         inherit ['i, 'o, 'control, 'notify, 'state, 'af, 'st]
             Iom_socket.endpoint
 
         (** Called in [self#state0] (unless [?addrs] is [None]) to construct
             an initiator gadget for the source and destination address with
-            the plug provided.  The initiator is started and the state is set
+            the pad provided.  The initiator is started and the state is set
             to [`S_initiating].
         *)
         method virtual private initiator:
             src:'af Nx_socket.sockaddr -> dst:'af Nx_socket.sockaddr ->
-            ('x, 'cx, 'nx) Iom_stream.iplug -> #Iom_gadget.start
+            ('x, 'cx, 'nx) Iom_stream.ipad -> #Iom_gadget.start
     end
 
 (** {6 Specializer Functor}
         method remote: address
     end
 
-    (** The jack for controlling a socket connection initator gadget. *)
+    (** The fix for controlling a socket connection initator gadget. *)
     type initiator =
         (connection, Iom_stream.flowcontrol, Iom_stream.failed)
-        Iom_stream.ijack
+        Iom_stream.ifix
 
-    (** The jack for controlling a socket connection listener gadget. *)
+    (** The fix for controlling a socket connection listener gadget. *)
     type listener =
         (connection, Iom_stream.flowcontrol, address listener_notify)
-        Iom_stream.ijack
+        Iom_stream.ifix
     
-    (** The jack for controlling a socket endpoint gadget. *)
-    type endpoint = endpoint_jack
+    (** The fix for controlling a socket endpoint gadget. *)
+    type endpoint = endpoint_fix
     
     (** Use [socket ()] as convenient constructor for socket descriptors. *)
     val socket: unit -> t
 
-    (** Evaluate [initator ?s ?src ~dst k] to obtain the jack for a connection
+    (** Evaluate [initator ?s ?src ~dst k] to obtain the fix for a connection
         initiator to the destination [dst] in the kernel context [k].  If [src]
         is provided, then bind explicity to that local address.  If [s] is
         not provided, then construct a new socket.
         ?s:t -> ?src:address -> dst:address -> Iom_gadget.kernel ->
         initiator Iom_gadget.t
 
-    (** Evaluate [listener ?s ?src ~backlog k] to obtain the jack for a
+    (** Evaluate [listener ?s ?src ~backlog k] to obtain the fix for a
         connection listener in the kernel context [k].  If [src] is not
         provided, then bind to an unspecified address.  If [s] is not provided,
         then construct a new socket.
         ?s:t -> ?src:address -> backlog:int -> Iom_gadget.kernel ->
         listener Iom_gadget.t
 
-    (** Evaluate [endpoint ?s ?addrs ~limits k] to obtain the jack for an
+    (** Evaluate [endpoint ?s ?addrs ~limits k] to obtain the fix for an
         endpoint controller constrained on receive by [limits] in the kernel
         context [k].  If [addrs] is provided, then bind explicitly to the first
         address and connect to the second address before notifying ready to

File iom/iom_socket.ml

 type ('ci, 'co, 'ni, 'no) state = [
         | `S_failed of exn
         | `S_established of
-            ('ci, 'ni) Iom_gadget.jack * ('co, 'no) Iom_gadget.jack
+            ('ci, 'ni) Iom_gadget.fix * ('co, 'no) Iom_gadget.fix
     ]
     constraint 'ci = [> Iom_stream.flowcontrol ]
     constraint 'co = [> Iom_stream.stop ]
     constraint 'ni = [> Iom_stream.failed ]
-    constraint 'no = [> Iom_reactor.notify ]
+    constraint 'no = [> Iom_stream.flownotify ]
 
 class virtual ['i, 'o, 'control, 'notify, 'state, 'af, 'st]
-  endpoint ~k ~s ioPlug =
-    let ioPlug = (ioPlug : ('i, 'o, 'control, 'notify) Iom_stream.ioplug) in
-    let (dnRx, upTx), (controlRx, notifyTx) = ioPlug in
+    endpoint ~k ~s iopad =
+    let iopad = (iopad : ('i, 'o, 'control, 'notify) Iom_stream.iopad) in
+    let (dnRx, upTx), (controlRx, notifyTx) = iopad in
     let _ = (k : Iom_gadget.kernel) in
     object(self:'self)
         inherit Iom_gadget.start
         inherit Iom_gadget.next
 
         constraint 'control = [> Iom_stream.flowcontrol ]
-        constraint 'notify = [> Iom_reactor.notify ]
+        constraint 'notify = [> Iom_stream.flownotify ]
         constraint 'state = [> ('ci, 'co, 'ni, 'no) state ]
 
         val state_: 'state =
         method virtual private state0: 'state Iom_gadget.t
         
         method virtual private receiver:
-            ('i, 'ci, 'ni) Iom_stream.iplug -> #Iom_gadget.start
+            ('i, 'ci, 'ni) Iom_stream.ipad -> #Iom_gadget.start
 
         method virtual private sender:
-            ('o, 'co, 'no) Iom_stream.oplug -> #Iom_gadget.start
+            ('o, 'co, 'no) Iom_stream.opad -> #Iom_gadget.start
 
-        method private receiver_aux_ plug = self#receiver (upTx, plug)
-        method private sender_aux_ plug = self#sender (dnRx, plug)
+        method private receiver_aux_ pad = self#receiver (upTx, pad)
+        method private sender_aux_ pad = self#sender (dnRx, pad)
 
         method private establish: 'state Iom_gadget.t =
             Iom_gadget.create self#receiver_aux_ >>= fun iJack ->

File iom/iom_socket.mli

         
         (** The socket is established for simultaneous reading and writing. *)
         | `S_established of
-            ('ci, 'ni) Iom_gadget.jack * ('co, 'no) Iom_gadget.jack
+            ('ci, 'ni) Iom_gadget.fix * ('co, 'no) Iom_gadget.fix
     ]
     constraint 'ci = [> Iom_stream.flowcontrol ]
     constraint 'co = [> Iom_stream.stop ]
     constraint 'ni = [> Iom_stream.failed ]
-    constraint 'no = [> Iom_reactor.notify ]
+    constraint 'no = [> Iom_stream.flownotify ]
 
-(** Use [inherit endpoint ~k ~s plug] to derive a subclass for the socket
+(** Use [inherit endpoint ~k ~s pad] to derive a subclass for the socket
     endpoint control semantics required by the type of socket [s].
 *)
 class virtual ['i, 'o, 'control, 'notify, 'state, 'af, 'st] endpoint :
     k:Iom_gadget.kernel -> s:('af, 'st) Nx_socket.t ->
-    ('i, 'o, 'control, 'notify) Iom_stream.ioplug ->
+    ('i, 'o, 'control, 'notify) Iom_stream.iopad ->
     object
         inherit Iom_gadget.start
         inherit Iom_gadget.next
         constraint 'control = [> Iom_stream.flowcontrol ]
-        constraint 'notify = [> Iom_reactor.notify ]
+        constraint 'notify = [> Iom_stream.flownotify ]
         constraint 'state = [> ('ci, 'co, 'ni, 'no) state ]
 
         (** The state of the socket. *)
             read side of the socket.
         *)
         method virtual private receiver:
-            ('i, 'ci, 'ni) Iom_stream.iplug -> #Iom_gadget.start
+            ('i, 'ci, 'ni) Iom_stream.ipad -> #Iom_gadget.start
         
         (** Called by [self#establish] to start a sender I/O gadget for the
             write side of the socket.
         *)
         method virtual private sender:
-            ('o, 'co, 'no) Iom_stream.oplug -> #Iom_gadget.start
+            ('o, 'co, 'no) Iom_stream.opad -> #Iom_gadget.start
 
         (** Calls [self#receiver] and [self#sender], starts the resulting
             receiver and sender gadgets, notifies [`Ready], and sets the socket
             Derived classes may need to override for handling guards in
             additional states.
         *)
-        method private stateguard: (Iom_gadget.gates, unit) Cf_cmonad.t
+        method private stateguard: unit Iom_gadget.guard
         
         (** Guards on the control wire, dispatching events with [self#control],
             and calls [self#stateguard] for the rest of the guard.

File iom/iom_stream.ml

 type more = Last | More
 class type event = object method more: more end
 
-type ('x, 'c, 'n) plug = 'x * ('c, 'n) Iom_gadget.plug
+type ('x, 'c, 'n) pad = 'x * ('c, 'n) Iom_gadget.pad
     constraint 'c = [> stop ]
     constraint 'n = [> failed ]
 
-type ('x, 'c, 'n) jack = 'x * ('c, 'n) Iom_gadget.jack
+type ('x, 'c, 'n) fix = 'x * ('c, 'n) Iom_gadget.fix
     constraint 'c = [> stop ]
     constraint 'n = [> failed ]
 
-type ('i, 'c, 'n) iplug = ('i Iom_gadget.tx, 'c, 'n) plug
+type ('i, 'c, 'n) ipad = ('i Iom_gadget.tx, 'c, 'n) pad
     constraint 'c = [> readywait ]
     
-type ('i, 'c, 'n) ijack = ('i Iom_gadget.rx, 'c, 'n) jack
+type ('i, 'c, 'n) ifix = ('i Iom_gadget.rx, 'c, 'n) fix
     constraint 'c = [> readywait ]
 
-type ('o, 'c, 'n) oplug = ('o Iom_gadget.rx, 'c, 'n) plug
+type ('o, 'c, 'n) opad = ('o Iom_gadget.rx, 'c, 'n) pad
     constraint 'n = [> readywait ]
 
-type ('o, 'c, 'n) ojack = ('o Iom_gadget.tx, 'c, 'n) jack
+type ('o, 'c, 'n) ofix = ('o Iom_gadget.tx, 'c, 'n) fix
     constraint 'n = [> readywait ]
 
-type ('i, 'o, 'c, 'n) ioplug = (('o, 'i) Iom_gadget.plug, 'c, 'n) plug
+type ('i, 'o, 'c, 'n) iopad = (('o, 'i) Iom_gadget.pad, 'c, 'n) pad
     constraint 'c = [> readywait ]
     constraint 'n = [> readywait ]
 
-type ('i, 'o, 'c, 'n) iojack = (('o, 'i) Iom_gadget.jack, 'c, 'n) jack
+type ('i, 'o, 'c, 'n) iofix = (('o, 'i) Iom_gadget.fix, 'c, 'n) fix
     constraint 'c = [> readywait ]
     constraint 'n = [> readywait ]
 
-let ijack f =
+let ifix f =
     Iom_gadget.simplex >>= fun (inRx, inTx) ->
-    Iom_gadget.create (fun plug -> f (inTx, plug)) >>= fun jack ->
-    Cf_cmonad.return (inRx, jack)
+    Iom_gadget.create (fun pad -> f (inTx, pad)) >>= fun fix ->
+    Cf_cmonad.return (inRx, fix)
 
-let ojack f =
+let ofix f =
     Iom_gadget.simplex >>= fun (inRx, inTx) ->
-    Iom_gadget.createM begin fun plug ->
-        let _, notifyTx = plug in
+    Iom_gadget.createM begin fun pad ->
+        let _, notifyTx = pad in
         notifyTx#put `Ready >>= fun () ->
-        Cf_cmonad.return (f (inRx, plug))
-    end >>= fun jack ->
-    Cf_cmonad.return (inTx, jack)
+        Cf_cmonad.return (f (inRx, pad))
+    end >>= fun fix ->
+    Cf_cmonad.return (inTx, fix)
 
-let iojack f =
-    Iom_gadget.duplex >>= fun (ioJack, ioPlug) ->
-    Iom_gadget.createM begin fun plug ->
-        let _, notifyTx = plug in
+let iofix f =
+    Iom_gadget.duplex >>= fun (iofix, iopad) ->
+    Iom_gadget.createM begin fun pad ->
+        let _, notifyTx = pad in
         notifyTx#put `Ready >>= fun () ->
-        Cf_cmonad.return (f (ioPlug, plug))
-    end >>= fun jack ->
-    Cf_cmonad.return (ioJack, jack)
+        Cf_cmonad.return (f (iopad, pad))
+    end >>= fun fix ->
+    Cf_cmonad.return (iofix, fix)
 
 class virtual ['c, 'n] substate =
     object(self:'self)
         method private fail: 'a. exn -> 'a Iom_gadget.t = fun _ -> self#stop
     end
 
-class virtual ['c, 'n] control plug =
-    let controlRx, notifyTx = (plug :> ('c, 'n) Iom_gadget.plug) in
+class virtual ['c, 'n] control pad =
+    let controlRx, notifyTx = (pad :> ('c, 'n) Iom_gadget.pad) in
     object(self)
         inherit ['c, 'n] substate as super
         
         method private guard = controlRx#get self#control
     end
 
-class virtual ['c, 'n] notify jack =
-    let notifyRx, _ = (jack :> ('c, 'n) Iom_gadget.jack) in
+class virtual ['c, 'n] notify fix =
+    let notifyRx, _ = (fix :> ('c, 'n) Iom_gadget.fix) in
     object(self)
         inherit ['c, 'n] substate as super
         
         method private guard = notifyRx#get self#notify
     end
 
-class ['c, 'n] engine jack = object
-    inherit ['c, 'n] notify jack
+class ['c, 'n] engine fix = object
+    inherit ['c, 'n] notify fix
     inherit Iom_gadget.start
     inherit Iom_gadget.next
 end
 
-class ['c, 'n] driver plug = object
-    inherit ['c, 'n] control plug
+class ['c, 'n] driver pad = object
+    inherit ['c, 'n] control pad
     inherit Iom_gadget.start
     inherit Iom_gadget.next
 end
 
-class ['c, 'n] process jack plug =
-    let jack = (jack :> ('c, 'n) Iom_gadget.jack) in
-    let plug = (plug :> ('c, 'n) Iom_gadget.plug) in
-    let (_, controlTx : ('c, 'n) Iom_gadget.jack) = jack in
-    let (_, notifyTx : ('c, 'n) Iom_gadget.plug) = plug in
+class ['c, 'n] process fix pad =
+    let fix = (fix :> ('c, 'n) Iom_gadget.fix) in
+    let pad = (pad :> ('c, 'n) Iom_gadget.pad) in
+    let (_, controlTx : ('c, 'n) Iom_gadget.fix) = fix in
+    let (_, notifyTx : ('c, 'n) Iom_gadget.pad) = pad in
     object(self)
-        inherit ['c, 'n] notify jack as notify
+        inherit ['c, 'n] notify fix as notify
         method virtual private stop: 'a. 'a Iom_gadget.t
         method virtual private fail: 'a. exn -> 'a Iom_gadget.t
         method virtual private guard: unit Iom_gadget.guard
-        inherit ['c, 'n] control plug as control
+        inherit ['c, 'n] control pad as control
         inherit Iom_gadget.start
         inherit Iom_gadget.next
 

File iom/iom_stream.mli

 
 (** {6 Plugs and Jacks} *)
 
-(** A plug type for all stream gadgets. *)
-type ('x, 'c, 'n) plug = 'x * ('c, 'n) Iom_gadget.plug
+(** A pad type for all stream gadgets. *)
+type ('x, 'c, 'n) pad = 'x * ('c, 'n) Iom_gadget.pad
     constraint 'c = [> stop ]
     constraint 'n = [> failed ]
 
-(** A jack type for all stream gadgets. *)
-type ('x, 'c, 'n) jack = 'x * ('c, 'n) Iom_gadget.jack
+(** A fix type for all stream gadgets. *)
+type ('x, 'c, 'n) fix = 'x * ('c, 'n) Iom_gadget.fix
     constraint 'c = [> stop ]
     constraint 'n = [> failed ]
 
-(** A specialization of the plug type for simplex producer stream gadgets. *)
-type ('i, 'c, 'n) iplug = ('i Iom_gadget.tx, 'c, 'n) plug
+(** A specialization of the pad type for simplex producer stream gadgets. *)
+type ('i, 'c, 'n) ipad = ('i Iom_gadget.tx, 'c, 'n) pad
     constraint 'c = [> readywait ]
     
-(** A specialization of the jack type for simplex producer stream gadgets. *)
-type ('i, 'c, 'n) ijack = ('i Iom_gadget.rx, 'c, 'n) jack
+(** A specialization of the fix type for simplex producer stream gadgets. *)
+type ('i, 'c, 'n) ifix = ('i Iom_gadget.rx, 'c, 'n) fix
     constraint 'c = [> readywait ]
 
-(** A specialization of the plug type for simplex consumer stream gadgets. *)
-type ('o, 'c, 'n) oplug = ('o Iom_gadget.rx, 'c, 'n) plug
+(** A specialization of the pad type for simplex consumer stream gadgets. *)
+type ('o, 'c, 'n) opad = ('o Iom_gadget.rx, 'c, 'n) pad
     constraint 'n = [> readywait ]
 
-(** A specialization of the jack type for simplex consumer stream gadgets. *)
-type ('o, 'c, 'n) ojack = ('o Iom_gadget.tx, 'c, 'n) jack
+(** A specialization of the fix type for simplex consumer stream gadgets. *)
+type ('o, 'c, 'n) ofix = ('o Iom_gadget.tx, 'c, 'n) fix
     constraint 'n = [> readywait ]
 
-(** A specialization of the plug type for duplex stream gadgets. *)
-type ('i, 'o, 'c, 'n) ioplug = (('o, 'i) Iom_gadget.plug, 'c, 'n) plug
+(** A specialization of the pad type for duplex stream gadgets. *)
+type ('i, 'o, 'c, 'n) iopad = (('o, 'i) Iom_gadget.pad, 'c, 'n) pad
     constraint 'c = [> readywait ]
     constraint 'n = [> readywait ]
 
-(** A specialization of the jack type for duplex stream gadgets. *)
-type ('i, 'o, 'c, 'n) iojack = (('o, 'i) Iom_gadget.jack, 'c, 'n) jack
+(** A specialization of the fix type for duplex stream gadgets. *)
+type ('i, 'o, 'c, 'n) iofix = (('o, 'i) Iom_gadget.fix, 'c, 'n) fix
     constraint 'c = [> readywait ]
     constraint 'n = [> readywait ]
 
-(** Use [ijack f] to create a harness of wires, with an [iplug] at one end and
-    a matching [ijack] at the other.  The plug is applied to [f] to obtain a
-    gadget object, its start method is applied, and the [ijack] is returned.
+(** Use [ifix f] to create a harness of wires, with an [ipad] at one end and
+    a matching [ifix] at the other.  The pad is applied to [f] to obtain a
+    gadget object, its start method is applied, and the [ifix] is returned.
 *)
-val ijack:
-  (('i, 'c, 'n) iplug -> #Iom_gadget.start) -> ('i, 'c, 'n) ijack Iom_gadget.t
+val ifix:
+  (('i, 'c, 'n) ipad -> #Iom_gadget.start) -> ('i, 'c, 'n) ifix Iom_gadget.t
 
-(** Use [ojack f] to create a harness of wires, with an [oplug] at one end and
-    a matching [ojack] at the other.  The plug is applied to [f] to obtain a
-    gadget object, its start method is applied, and the [ojack] is returned.
+(** Use [ofix f] to create a harness of wires, with an [opad] at one end and
+    a matching [ofix] at the other.  The pad is applied to [f] to obtain a
+    gadget object, its start method is applied, and the [ofix] is returned.
 *)
-val ojack:
-  (('o, 'c, 'n) oplug -> #Iom_gadget.start) -> ('o, 'c, 'n) ojack Iom_gadget.t
+val ofix:
+  (('o, 'c, 'n) opad -> #Iom_gadget.start) -> ('o, 'c, 'n) ofix Iom_gadget.t
 
-(** Use [iojack f] to create a harness of wires, with an [ioplug] at one end
-    and a matching [iojack] at the other.  The plug is applied to [f] to obtain
-    a gadget object, its start method is applied, and the [iojack] is returned.
+(** Use [iofix f] to create a harness of wires, with an [iopad] at one end
+    and a matching [iofix] at the other.  The pad is applied to [f] to obtain
+    a gadget object, its start method is applied, and the [iofix] is returned.
 *)
-val iojack:
-  (('i, 'o, 'c, 'n) ioplug -> #Iom_gadget.start) ->
-  ('i, 'o, 'c, 'n) iojack Iom_gadget.t
+val iofix:
+  (('i, 'o, 'c, 'n) iopad -> #Iom_gadget.start) ->
+  ('i, 'o, 'c, 'n) iofix Iom_gadget.t
 
 
 (** {6 Gadgets }
     method private stop: 'a. 'a Iom_gadget.t
 end
 
-(** Use [inherit control plug] to derive a stream gadget state that receives
-    events on the control wire in [plug].
+(** Use [inherit control pad] to derive a stream gadget state that receives
+    events on the control wire in [pad].
 *)
 class virtual ['c, 'n] control:
     ('c #Iom_gadget.rx * 'n #Iom_gadget.tx) ->
     object
         inherit ['c, 'n] substate
         
-        (** When events are received on the control wire in [plug], they are
+        (** When events are received on the control wire in [pad], they are
             dispatched to [self#control event] and the returned action is
             evaluated.
         *)
         method private control: 'c -> unit Iom_gadget.t
         
         (** Invoke the [guard] method on the inherited base class to guard on
-            the control events for [plug].
+            the control events for [pad].
         *)
         method private guard: unit Iom_gadget.guard
     end
 
-(** Use [inherit notify jack] to derive a stream gadget state that receives
-    events on the notification wire in [jack].
+(** Use [inherit notify fix] to derive a stream gadget state that receives
+    events on the notification wire in [fix].
 *)
 class virtual ['c, 'n] notify:
     ('n #Iom_gadget.rx * 'c #Iom_gadget.tx) ->
     object
         inherit ['c, 'n] substate
         
-        (** When events are received on the notification wire in [jack], they
+        (** When events are received on the notification wire in [fix], they
             are dispatched to [self#notify event] and the returned action is
             evaluated.
         *)
         method private notify: 'n -> unit Iom_gadget.t
         
         (** Invoke the [guard] method on the inherited base class to guard on
-            the notification events for [jack].
+            the notification events for [fix].
         *)
         method private guard: unit Iom_gadget.guard
     end
 
-(** Use [inherit engine jack] to derive a stream gadget that receives events
-    on the notification wire and sends events on the control wire in [jack].
+(** Use [inherit engine fix] to derive a stream gadget that receives events
+    on the notification wire and sends events on the control wire in [fix].
 *)
 class ['c, 'n] engine:
     ('n #Iom_gadget.rx * 'c #Iom_gadget.tx) ->
         inherit Iom_gadget.next
     end
 
-(** Use [inherit driver plug] to derive a stream gadget that receives events
-    on the control wire and sends events on the notification wire in [plug].
+(** Use [inherit driver pad] to derive a stream gadget that receives events
+    on the control wire and sends events on the notification wire in [pad].
 *)
 class ['c, 'n] driver:
     ('c #Iom_gadget.rx * 'n #Iom_gadget.tx) ->
         inherit Iom_gadget.next
     end
 
-(** Use [inherit process jack plug] to derive a stream gadget that processes
-    events received on the control wire in [plug] and forwards them on the
-    control wire in [jack].  Likewise, it processes events received on the
-    notification wire in [jack] and forwards them on the notification wire in
-    [plug].
+(** Use [inherit process fix pad] to derive a stream gadget that processes
+    events received on the control wire in [pad] and forwards them on the
+    control wire in [fix].  Likewise, it processes events received on the
+    notification wire in [fix] and forwards them on the notification wire in
+    [pad].
 *)
 class ['c, 'n] process:
     ('n #Iom_gadget.rx * 'c #Iom_gadget.tx) ->

File iom/t/t_iom.ml

     let backlog = 1
     let limits = { Iom_octet_stream.low = 1; high = 1000 }
     
-    type exchange_jack =
-        [ Iom_stream.failed | Iom_reactor.complete ] Iom_gadget.rx
+    type complete = [ `Complete ]
+    
+    type exchange_jack = [ Iom_stream.failed | complete ] Iom_gadget.rx
     
     let fragment s =
         new Iom_octet_stream.fragment Iom_stream.Last (Cf_message.create s)
             method private notify = function
                 | `Failed x ->
                     self#fail x
-                | `Complete ->
-                    assert (jout#debug "F0.exchange#notify: `Complete");
-                    self#next
                 | `Ready ->
                     assert (jout#debug "F0.exchange#notify: `Ready");
                     self#next