# Class Netchannels.output_channel

    class output_channel : ?onclose:unit -> unit -> Pervasives.out_channel -> out_obj_channel

Creates an output channel writing into an `out_channel`.

The method `pos_out` reflects the real position in the channel as returned by `Pervasives.pos_out`. This works for both seekable and non-seekable channels.

The method `close_out` also closes the underlying `out_channel`. There is some implicit logic to either use `close_out` or `close_out_noerr` depending on whether the immediately preceding operation already reported an error.

`onclose` : this function is called when the `close_out` method is invoked, just after the underlying `out_channel` has been closed.