class Transport

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.cr

Class Method Summary

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.


[View source]
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.


[View source]
def self.start(input_stream : Channel, output_stream : Channel) #

Creates a native messaging connection via stdio.


[View source]