1%%--------------------------------------------------------------------
2%%
3%% %CopyrightBegin%
4%%
5%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
6%%
7%% Licensed under the Apache License, Version 2.0 (the "License");
8%% you may not use this file except in compliance with the License.
9%% You may obtain a copy of the License at
10%%
11%%     http://www.apache.org/licenses/LICENSE-2.0
12%%
13%% Unless required by applicable law or agreed to in writing, software
14%% distributed under the License is distributed on an "AS IS" BASIS,
15%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16%% See the License for the specific language governing permissions and
17%% limitations under the License.
18%%
19%% %CopyrightEnd%
20%%
21%%
22%%----------------------------------------------------------------------
23%% File    : orber_test_timeout_server_impl.erl
24%% Purpose :
25%%----------------------------------------------------------------------
26
27-module(orber_test_timeout_server_impl).
28
29-export([oneway_function/3, twoway_function/3]).
30
31
32%%--------------- gen_server specific ------------------------
33-export([init/1, terminate/2, code_change/3, handle_info/2]).
34
35%%------------------------------------------------------------
36%% function : server specific
37%%------------------------------------------------------------
38init(State) ->
39    %% 'trap_exit' optional
40    process_flag(trap_exit,true),
41    {ok, State}.
42
43terminate(_Reason, _State) ->
44    ok.
45
46code_change(_OldVsn, State, _Extra) ->
47    {ok, State}.
48
49%% If use IC option {{handle_info, "Module::Interface"}, true}
50handle_info(_Info, State) ->
51    %% Await the next invocation.
52    {noreply, State}.
53
54%%--- two-way ------------------------------------------------
55twoway_function(_OE_THIS, State, Time) ->
56    timer:sleep(Time),
57    {reply, ok, State}.
58
59
60%%--- one-way ------------------------------------------------
61oneway_function(_OE_THIS, State, Time) ->
62    timer:sleep(Time),
63    {noreply, State}.
64
65%%--------------- END OF MODULE ------------------------------
66
67