ExTermbox.PortHandler.InitHandler (ExTermbox v1.1.2)
View SourceHandles the initialization logic (init/1
callback and related messages) for ExTermbox.PortHandler
.
Summary
Functions
Handles a timeout during the initialization phase.
Replies error to the original start_link
caller and prepares state for stop.
Handles incoming data packets received via the Port during the initial phase. It buffers data and attempts to parse the 'OK <socket_path>' line. Once the path is found, it initiates the UDS connection attempt.
The main entry point for PortHandler initialization. Finds the C helper, spawns the Port, sends the initial trigger, and returns the initial state or stop reason.
Functions
Handles a timeout during the initialization phase.
Replies error to the original start_link
caller and prepares state for stop.
Handles incoming data packets received via the Port during the initial phase. It buffers data and attempts to parse the 'OK <socket_path>' line. Once the path is found, it initiates the UDS connection attempt.
Returns:
{:noreply, state_updates_map, timeout | nil}
: If more data is needed or connection started.{:stop, reason, state_updates_map}
: If parsing fails or connection initiation fails.
The main entry point for PortHandler initialization. Finds the C helper, spawns the Port, sends the initial trigger, and returns the initial state or stop reason.