View Source WebSockex.Frame (WebSockex v0.4.3)
Functions for parsing and encoding frames.
Summary
Functions
Encodes a frame into a binary for sending.
Parses and combines two frames in a fragmented segment.
Parses a bitstring and returns a frame.
Types
Functions
@spec encode_frame(frame()) :: {:ok, binary()} | {:error, %WebSockex.FrameEncodeError{ __exception__: true, close_code: term(), frame_payload: term(), frame_type: term(), reason: term() }}
Encodes a frame into a binary for sending.
@spec parse_fragment( {:fragment, :text | :binary, binary()}, {:continuation | :finish, binary()} ) :: {:fragment, :text | :binary, binary()} | {:text | :binary, binary()} | {:error, %WebSockex.FragmentParseError{ __exception__: true, continuation: term(), fragment: term(), reason: term() }}
Parses and combines two frames in a fragmented segment.
@spec parse_frame(bitstring()) :: :incomplete | {:ok, frame(), buffer()} | {:error, %WebSockex.FrameError{ __exception__: true, buffer: term(), opcode: term(), reason: term() }}
Parses a bitstring and returns a frame.