Handbook
Glossary
get-write-payload-length ( bytes -- length-byte length-bytes/f )
Vocabulary
http
.
websockets
Inputs
bytes
an
object
Outputs
length-byte
an
object
length-bytes/f
an
object
Definition
USING:
combinators
endian
kernel
math
sequences
;
IN:
http.websockets
:
get-write-payload-length
( bytes -- length-byte length-bytes/f )
length
{
{
[
dup
125
<=
]
[
f
]
}
{
[
dup
65535
<=
]
[
[
drop
126
]
[
2
>be
]
bi
]
}
[
[
drop
127
]
[
8
>be
]
bi
]
}
cond
;