net.ws.client
WebSocket клиент
доступно с версии: 0.9.8

методы:
-
close
gracefully close connection (with websocket handshake)
- connect
connect to websocket server
параметры:
- URL url - ws://HOST:PORT/, for ex.: ws://127.0.0.1:9000/path
тип: symbol
обязательно: True
-
flush
flush output stream: sends all buffered messages.
-
latency
measure rountrip latency. Outputs: latency TIME_MSEC
- ping
send ping message to server (on server answer outputs: pong DATA)
параметры:
- [DATA] list of integers in [0..255] range
тип: list
- send
send as text message
параметры:
- [ARGS] arguments
тип: list
- send_array
send as Pd array content as json array
параметры:
-
ARR array name
тип: symbol
обязательно: True
-
[START=0] array start index
тип: int
единица: samp
-
[LENGTH] read length. If not specified - read until array end.
тип: int
единица: samp
- send_binary
send as binary bytes
параметры:
- [ARGS] list of integers in [0..255] range
тип: list
- send_json
send as encoded json
параметры:
- [ARGS] arguments
тип: list
- write
write as text message to output buffer. You have to call [flush( method for
sending.
параметры:
- [ARGS] arguments
тип: list
- write_binary
write as binary bytes to output buffer. You have to call [flush( method for
sending.
параметры:
- [ARGS] list of integers in [0..255] range
тип: list
- write_json
write as encoded json to output buffer. You have to call [flush( method for
sending.
параметры:
- [ARGS] arguments
тип: list
свойства:
- @mode
Запросить/установить parsing mode for incoming messages. If 'fudi' - interpret incoming websocket
data as Pd messages, if 'sym' - always interpret as symbols, 'data' - parse
ceammc data, 'json' - convert json values to ceammc data.
тип: symbol
варианты: data, fudi, json, sym
по умолчанию: fudi
входы:
- message input
тип: control
выходы:
- output messages: latency, ping, text, binary, closed, connected, disconnected
тип: control
ключевые слова:
websocket
net
client
Смотрите также:
[net.ws.server]
Авторы: Serge Poltavsky
Лицензия: GPL3 or later