class

Transport

Inherits Reference < Object

This class provides the functionality to transport messages over stdio. Native messaging protocol: https://developer.chrome.com/docs/extensions/mv3/nativeMessaging/#native-messaging-host-protocol

Class methods

receive(server_input : IO, input_stream : Channel(Message)) forall Message

Reads messages. Step 1: Read the message size (first 4 bytes). Step 2: Read the text (JSON object) of the message.

Source
send(output_stream : Channel(Message), server_output : IO) forall Message

Sends messages. Step 1: Write the message size. Step 2: Write the message itself.

Source
start(input_stream : Channel, output_stream : Channel)

Creates a native messaging connection via stdio.

Source