class Transport
- Transport
- Reference
- Object
Overview
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
Defined in:
transport.crClass Method Summary
-
.receive(server_input : IO, input_stream : Channel(Message)) forall Message
Reads messages.
-
.send(output_stream : Channel(Message), server_output : IO) forall Message
Sends messages.
-
.start(input_stream : Channel, output_stream : Channel)
Creates a native messaging connection via stdio.
Class Method Detail
def self.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.
def self.send(output_stream : Channel(Message), server_output : IO) forall Message
#
Sends messages. Step 1: Write the message size. Step 2: Write the message itself.
def self.start(input_stream : Channel, output_stream : Channel)
#
Creates a native messaging connection via stdio.