From 84878c12755a181ef28039e7dc37c1e1bb294bee Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 1 Jul 2019 14:56:59 +0200 Subject: add outcommented code for testing remote timeouts --- p11p-daemon/src/p11p_remote.erl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'p11p-daemon') diff --git a/p11p-daemon/src/p11p_remote.erl b/p11p-daemon/src/p11p_remote.erl index 9047cad..158b427 100644 --- a/p11p-daemon/src/p11p_remote.erl +++ b/p11p-daemon/src/p11p_remote.erl @@ -112,7 +112,16 @@ do_add_to_outbuf(Data, #state{outbuf = Buf} = State) -> do_send(#state{port = Port, outbuf = Buf} = State) -> %%lager:debug("~p: sending ~B octets to remote", [self(), size(Buf)]), + + %% case rand:uniform(15) of + %% 1 -> + %% lager:debug("~p: faking unresponsive remote (~p) by not sending it any.", [self(), Port]); + %% _ -> + %% port_command(Port, Buf) + %% end, + port_command(Port, Buf), + State#state{outbuf = <<>>}. handle_remote_data(#state{replyto = Pid, timer = Timer} = State, Msg, Data) -> -- cgit v1.1