object
http_websocket_frames
Transport-neutral WebSocket frame predicates for constructing, parsing, generating, reading, and writing normalized frame terms.
logtalk_load(http_websocket_frames(loader))static, context_switching_callsPublic predicates
frame/5
Constructs a validated normalized WebSocket frame term from the fragmentation state atom, opcode atom, payload bytes, and frame properties.
staticframe(Final,Opcode,Payload,Properties,Frame)frame(+atom,+atom,+list(byte),+list(compound),-compound) - one_or_errorFinal is not a valid WebSocket final flag:domain_error(http_websocket_final,Final)Opcode is not a valid WebSocket opcode:domain_error(http_websocket_opcode,Opcode)Payload is a variable or a partial list:instantiation_errorPayload is not a valid WebSocket payload byte list:domain_error(http_websocket_payload,Payload)Properties is a variable or a partial list:instantiation_errorProperties is not a valid WebSocket frame property list:domain_error(http_websocket_properties,Properties)domain_error(http_websocket_property,Property)domain_error(http_websocket_masking_key,Key)domain_error(http_websocket_reserved_bits,Bits)domain_error(http_websocket_frame,Frame)
Final atoms: Use
finalfor FIN=1 andmorefor FIN=0.Opcode atoms: Supported opcodes are
continuation,text,binary,close,ping, andpong.Property
masking_key(Key): Requests masking on the wire using a list of four mask bytes.Property
reserved_bits(Bits): Preserves reserved bits as an ordered list containing any ofrsv1,rsv2, andrsv3.
is_frame/1
True when the argument is a valid normalized WebSocket frame term.
staticis_frame(Frame)is_frame(@term) - zero_or_oneparse/2
Parses one WebSocket frame from a source term. Supported sources are bytes(Bytes), codes(Bytes), file(File), and stream(Stream). Empty sources return end_of_file.
staticparse(Source,Frame)parse(++compound,-term) - one_or_errorSource is a variable:instantiation_errorSource is neither a variable nor a valid WebSocket frame source term:domain_error(http_websocket_source,Source)domain_error(http_websocket_byte_sequence,Bytes)domain_error(http_websocket_opcode,Opcode)domain_error(http_websocket_frame_length,PayloadLength)domain_error(http_websocket_frame,Frame)generate/2
Generates one validated WebSocket frame to a sink term. Supported sinks are bytes(Bytes), codes(Bytes), file(File), and stream(Stream).
staticgenerate(Sink,Frame)generate(++compound,+compound) - one_or_errorSink is a variable:instantiation_errorSink is neither a variable nor a valid WebSocket frame sink term:domain_error(http_websocket_sink,Sink)Frame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)read_frame/2
Reads one WebSocket frame from a binary stream without requiring end-of-file. Returns end_of_file when the stream is already exhausted.
staticread_frame(Stream,Frame)read_frame(+stream_or_alias,-term) - one_or_errorStream is a variable:instantiation_errordomain_error(http_websocket_byte_sequence,Bytes)domain_error(http_websocket_payload_length_limit,PayloadLength)domain_error(http_websocket_frame,Frame)read_frame/3
Reads one WebSocket frame from a binary stream using the given read options. Returns end_of_file when the stream is already exhausted.
staticread_frame(Stream,Frame,Options)read_frame(+stream_or_alias,-term,+list) - one_or_errorStream is a variable:instantiation_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(http_websocket_payload_length_limit,PayloadLength)domain_error(http_websocket_byte_sequence,Bytes)domain_error(http_websocket_frame,Frame)
Repeated options: When the same read option is given multiple times, the first occurrence is used.
Option
max_payload_length(Bytes): Rejects frames whose declared payload length is greater thanBytesbefore allocating payload storage. Use a non-negative integer.
write_frame/2
Writes one validated WebSocket frame to a binary stream and flushes the stream.
staticwrite_frame(Stream,Frame)write_frame(+stream_or_alias,+compound) - one_or_errorStream is a variable:instantiation_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)final/2
Returns the fragmentation state atom of a validated WebSocket frame term.
staticfinal(Frame,Final)final(+compound,-atom) - one_or_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)opcode/2
Returns the opcode atom of a validated WebSocket frame term.
staticopcode(Frame,Opcode)opcode(+compound,-atom) - one_or_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)payload/2
Returns the payload byte list of a validated WebSocket frame term.
staticpayload(Frame,Payload)payload(+compound,-list(byte)) - one_or_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)properties/2
Returns the normalized property list of a validated WebSocket frame term.
staticproperties(Frame,Properties)properties(+compound,-list(compound)) - one_or_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)property/2
True when the validated WebSocket frame term contains the given property. When the property argument is a variable, properties can be enumerated on backtracking.
staticproperty(Frame,Property)property(+compound,?compound) - zero_or_one_or_errorFrame is not a valid normalized WebSocket frame term:domain_error(http_websocket_frame,Frame)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)