View Source edb_dap_transport (edb v0.4.0)

Transport layer of the DAP server This module deals with serialization/deserialization, sequencing and other low-level details of the DAP frontend for the edb Erlang debugger.

For the actual handling of requests, etc. see the edb_dap_server module.

Summary

Types

action()

-type action() ::
          {event, edb_dap:event_type(), edb_dap:arguments()} |
          {reverse_request, edb_dap:command(), edb_dap:body()} |
          terminate.

state()

-type state() :: #{io := port(), buffer := binary(), seq := pos_integer()}.

Functions

handle_call(Request, From, State)

-spec handle_call(term(), term(), state()) -> {noreply, state()}.

handle_cast/2

-spec handle_cast(Request, state()) -> {noreply, state()} when Request :: {send, map()}.

handle_info/2

-spec handle_info(InfoMessage, state()) -> {noreply, state()} | {stop, Reason :: normal, state()}
                     when InfoMessage :: {port(), {data, binary()} | eof}.

init/1

-spec init(noargs) -> {ok, state()}.

send_event(Event)

-spec send_event(Event) -> ok when Event :: edb_dap_event:event().

send_response(RequestContext, Response)

-spec send_response(RequestContext, Response) -> ok
                       when
                           RequestContext :: #{command := edb_dap:command(), seq := edb_dap:seq()},
                           Response :: edb_dap_request:response(edb_dap:body()).

send_reverse_request(Request)

-spec send_reverse_request(Request) -> ok when Request :: edb_dap_reverse_request:request().

start_link()

-spec start_link() -> {ok, pid()}.

terminate(Reason, State)

-spec terminate(Reason :: term(), state()) -> ok.