package websocket

  1. Overview
  2. Docs
Websocket library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

websocket-2.17.tbz
sha256=39af5eb5534b2df5b65ccf700b0a620438be5f09864a8e80b48ab60ee67a7a9c
sha512=a8cd168236acfa1156fac5a007fe6875a35f8fb03eee30a94eb712a2dc981a967bb8fb74fdd7aa7892d148176070333d49311ea9600f5a210e56be8da32197c8

doc/websocket/Websocket/module-type-S/IO/index.html

Module S.IOSource

Sourcetype +'a t

'a t represents a blocking monad state

Sourceval (>>=) : 'a t -> ('a -> 'b t) -> 'b t

a >>= b will pass the result of a to the b function. This is a monadic bind.

Sourceval return : 'a -> 'a t

return a will construct a constant IO value.

Sourcetype ic

ic represents an input channel

Sourcetype oc

oc represents an output channel

Sourcetype conn

conn represents the underlying network flow

Sourceval read_line : ic -> string option t

read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

Sourceval read : ic -> int -> string t

read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

Sourceval write : oc -> string -> unit t

write oc s will block until the complete s string is written to the output channel oc.

Sourceval flush : oc -> unit t

flush oc will return when all previously buffered content from calling write have been written to the output channel oc.