diff --git a/x04-noisy-echo/nechoc b/x04-noisy-echo/nechoc index f65cb18..a7ca7e0 100755 --- a/x04-noisy-echo/nechoc +++ b/x04-noisy-echo/nechoc @@ -20,9 +20,9 @@ main([]) -> main_ii(6969); main([PortNum]) -> main_ii(list_to_integer(PortNum)). main_ii(PortNum) -> - TcpOpts = [binary, {packet, 0}, {active, once}], + TcpOpts = [binary, {packet, 0}, {active, true}], {ok, TSock} = gen_tcp:connect("localhost", PortNum, TcpOpts), - ok = inet:setopts(TSock, [{active, once}]), + %ok = inet:setopts(TSock, [{active, once}]), {ok, NSock, _HandshakeState} = enoise:connect(TSock, noise_options()), % need keyboard process Self = self(), @@ -37,7 +37,7 @@ noise_options() -> j_loop(JS = #js{rcv = Rcv, tsock = TSock, nsock = NSock}) -> - ok = inet:setopts(TSock, [{active, once}]), + %ok = inet:setopts(TSock, [{active, once}]), receive {noise, NSock, Bytes} -> NewRcv = <>, diff --git a/x04-noisy-echo/nechod b/x04-noisy-echo/nechod index 008a14f..8e89f81 100755 --- a/x04-noisy-echo/nechod +++ b/x04-noisy-echo/nechod @@ -45,7 +45,7 @@ noise_options() -> % pimp process startup p_init(Port) -> p_logln("pimp startup (p_init)"), - Opts = [binary, {packet, 0}, {active, once}], + Opts = [binary, {packet, 0}, {active, true}], case gen_tcp:listen(Port, Opts) of {ok, LSock} -> ok = p_logfln("pimp starting: ~tp", [self()]), @@ -157,7 +157,7 @@ h_init(LSock, HS = #hs{name = Name, daddy = Daddy, asock = none, nsock = none}) h_loop(HS = #hs{name = Name, daddy = Daddy, asock = ASock, nsock = NSock}) -> - ok = inet:setopts(ASock, [{active, once}]), + %ok = inet:setopts(ASock, [{active, once}]), receive {noise, NSock, Data} -> Data_II = string:chomp(Data), diff --git a/x05-rq/rq b/x05-rq/rq new file mode 100755 index 0000000..ae72a5e --- /dev/null +++ b/x05-rq/rq @@ -0,0 +1 @@ +#!/usr/bin/env escrip