Module libp2p_framed_stream
This module defines the libp2p_framed_stream behaviour.
Required callback functions: server/4, client/2, init/3, handle_data/3.
Data Types
handle_call_result()
handle_call_result() = {reply, Reply::term(), ModState::any()} | {reply, Reply::term(), ModState::any(), Response::response()} | {noreply, ModState::any()} | {noreply, ModState::any(), Response::response()} | {stop, Reason::term(), Reply::term(), ModState::any()} | {stop, Reason::term(), ModState::any()} | {stop, Reason::term(), Reply::term(), ModState::any(), Response::response()} | {stop, Reason::term(), ModState::any(), Response::response()}
handle_cast_result()
handle_cast_result() = {noreply, ModState::any()} | {noreply, ModState::any(), Response::response()} | {stop, Reason::term(), ModState::any()} | {stop, Reason::term(), ModState::any(), Response::response()}
handle_data_result()
handle_data_result() = {noreply, ModState::any()} | {noreply, ModState::any(), Response::response()} | {stop, Reason::term(), ModState::any()} | {stop, Reason::term(), ModState::any(), Response::response()}
handle_info_result()
handle_info_result() = {noreply, ModState::any()} | {noreply, ModState::any(), Response::response()} | {stop, Reason::term(), ModState::any()} | {stop, Reason::term(), ModState::any(), Response::response()}
init_result()
init_result() = {ok, ModState::any()} | {ok, ModState::any(), Response::response()} | {stop, Reason::term()} | {stop, Reason::term(), Response::response()}
kind()
kind() = server | client
response()
response() = binary()
Function Index
| addr_info/1 | |
| client/3 | |
| close/1 | |
| close_state/1 | |
| connection/1 | |
| handle_call/3 | |
| handle_cast/2 | |
| handle_info/2 | |
| info/1 | |
| init/1 | |
| recv/2 | |
| send/2 | |
| send/3 | |
| server/3 | |
| server/4 | |
| session/1 | |
| terminate/2 |
Function Details
addr_info/1
addr_info(Pid) -> any()
client/3
client(Module::atom(), Connection::libp2p_connection:connection(), Args::[any()]) -> {ok, pid()} | {error, term()} | ignore
close/1
close(Pid) -> any()
close_state/1
close_state(Pid) -> any()
connection/1
connection(Pid) -> any()
handle_call/3
handle_call(Msg, From, State) -> any()
handle_cast/2
handle_cast(Request, State) -> any()
handle_info/2
handle_info(Msg, State) -> any()
info/1
info(Pid::pid()) -> map()
init/1
init(X1) -> any()
recv/2
recv(Connection::libp2p_connection:connection(), Timeout::non_neg_integer()) -> {ok, binary()} | {error, term()}
send/2
send(Pid, Data) -> any()
send/3
send(Pid, Data, Timeout) -> any()
server/3
server(Module::atom(), Connection::libp2p_connection:connection(), Args::[any()]) -> no_return() | {error, term()}
server/4
server(Connection, Path, TID, Args) -> any()
session/1
session(Pid::pid()) -> {ok, pid()} | {error, term()}
terminate/2
terminate(Reason, State) -> any()