diff options
Diffstat (limited to 'examples/tcp_reverse/src')
-rw-r--r-- | examples/tcp_reverse/src/reverse_protocol.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/tcp_reverse/src/reverse_protocol.erl b/examples/tcp_reverse/src/reverse_protocol.erl index 2c7c15b..80ed62c 100644 --- a/examples/tcp_reverse/src/reverse_protocol.erl +++ b/examples/tcp_reverse/src/reverse_protocol.erl @@ -38,7 +38,8 @@ init({Ref, Socket, Transport, _Opts = []}) -> ?TIMEOUT). handle_info({tcp, Socket, Data}, State=#state{ - socket=Socket, transport=Transport}) -> + socket=Socket, transport=Transport}) + when byte_size(Data) > 1 -> Transport:setopts(Socket, [{active, once}]), Transport:send(Socket, reverse_binary(Data)), {noreply, State, ?TIMEOUT}; |