Antano » Antano Server API » ReactSignaling
Antano® will be released very soon. This is an announcement text

Contents

Search

ReactSignaling

class services.signaling.ReactSignaling(_websocket, _service)

Bases: services.signaling.Signaling

React Signaling class this handles all communication for our React WebRTC client

Parameters:{Base Signaling} -- inherits from signaling (Signaling) –

Methods Summary

get_next_id() get next ID for webRtc user It should also set the self.id :returns: Int – next con_id
handle_existing_channel() Handles an existing channel basically creates the response for the client
on_connect() On connect is handled for newly opened websockets
pack_response(message_dict, message_type[, …]) Helper function for packing the response in a handleable format
process_message(message) Basic processing message
translate_broadcast(message, rtc_type) Translates a broadcast to other WebRTC clients This is a bit tricky as there is no standard for handling WebRTC in header-messages
translate_init(message, rtc_type[, _ws]) Translates a init message to other WebRTC clients This is a bit tricky as there is no standard for handling WebRTC in header-messages
translate_post_message(message, _type) Translating a postmessage (or more) for AppRTC communication pipeline
unpack_message(message) Helper for unpack the message basically simply json unpack to avoid a lot loc

Methods Documentation

get_next_id()

get next ID for webRtc user It should also set the self.id :returns: Int – next con_id

static handle_existing_channel()

Handles an existing channel basically creates the response for the client

Returns:Dict<String, Obj> – current response
on_connect()

On connect is handled for newly opened websockets

pack_response(message_dict, message_type, binary=False)

Helper function for packing the response in a handleable format

Parameters:
  • {Dict<String, Obj>} -- current message dict (message_dict) –
  • {String} -- message type (message_type) –
Keyword Arguments:
 

{bool} -- wether it is a binary message or not (default (binary) – {False})

Returns:

Dict<String, Obj> – handleable response

process_message(message)

Basic processing message

Parameters:{bytes[]} -- signaling message (message) –
Returns:response {bytes[]} – signaling response
translate_broadcast(message, rtc_type)

Translates a broadcast to other WebRTC clients This is a bit tricky as there is no standard for handling WebRTC in header-messages

Parameters:
  • {bytes[]} -- current message (message) –
  • {String} -- current rtc type (rtc_type) –
Raises:

NotImplementedError – If Signaling has no func included

translate_init(message, rtc_type, _ws=None)

Translates a init message to other WebRTC clients This is a bit tricky as there is no standard for handling WebRTC in header-messages

Parameters:
  • {bytes[]} -- current message (message) –
  • {String} -- current rtc type (rtc_type) –
Raises:

NotImplementedError – If Signaling has no func included

translate_post_message(message, _type)

Translating a postmessage (or more) for AppRTC communication pipeline

Parameters:
  • {bytes[]} -- message (message) –
  • {String} -- current type (_type) –
unpack_message(message)

Helper for unpack the message basically simply json unpack to avoid a lot loc

Parameters:{Dict<String, Obj>} -- message dict (message) –
Returns:bytes[] – packed message
Last update: 10/08/2020 3:43 a.m. (CET)