Module Brr_io.Websocket
Websocket
objects.
See Web Sockets API.
XXX Add a bit of future convenience.
module Binary_type : sig ... end
Binary type enum.
module Ready_state : sig ... end
Ready state enum.
type t
The type for
WebSocket
objects.
val create : ?protocols:Jv.Jstr.t list -> Jstr.t -> t
create ~protocols url
creates a new socket connected tourl
.
val as_target : t -> Brr.Ev.target
as_target s
iss
as an event target.
val binary_type : t -> Binary_type.t
binary_type s
is the type of binary data received.
val set_binary_type : t -> Binary_type.t -> unit
set_binary_type s t
sets thebinary_type
ofs
tot
.
Properties
val ready_state : t -> Ready_state.t
ready_state s
is the state of the connection.
val buffered_amount : t -> int
buffered_amount s
is the sent buffered amount ofs
.
val extensions : t -> Jstr.t
extensions s
are the extensions selected by the server.
Sending
val send_blob : t -> Brr.Blob.t -> unit
send_blob s d
sends the binary content ofd
ons
.
val send_array_buffer : t -> Brr.Tarray.Buffer.t -> unit
send_blob s d
sends the binary content ofd
ons
.
val send_tarray : t -> ('a, 'b) Brr.Tarray.t -> unit
send_blob s d
sends the binary content ofd
ons
.
Events
module Ev : sig ... end
Websocket events.