init(ProtocolGenerator, Service, Handler) ->
{ok, IProt, OProt} = ProtocolGenerator(),
- io:format("Processor started~n"),
loop(#state{in_protocol = IProt,
out_protocol = OProt,
service = Service,
ok= handle_function(State, list_to_atom(Function)),
loop(State);
{error, closed} ->
- error_logger:info_msg("Client disconnected~n"),
+ % error_logger:info_msg("Client disconnected~n"),
ok
end.
try
{Micro, Result} = better_timer(Handler, handle_function, [Function, Params]),
- error_logger:info_msg("Processed ~p(~p) in ~.4fms~n",
- [Function, Params, Micro/1000.0]),
+ % error_logger:info_msg("Processed ~p(~p) in ~.4fms~n",
+ % [Function, Params, Micro/1000.0]),
handle_success(State, Function, Result)
catch
throw:Exception when is_tuple(Exception), size(Exception) > 0 ->
acceptor(ListenSocket, Service, Handler)
when is_port(ListenSocket), is_atom(Handler) ->
{ok, Socket} = gen_tcp:accept(ListenSocket),
- error_logger:info_msg("Accepted client"),
-
+% error_logger:info_msg("Accepted client"),
ProtoGen = fun() ->
{ok, SocketTransport} = thrift_socket_transport:new(Socket),