aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test/client.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/observer/test/client.erl')
-rw-r--r--lib/observer/test/client.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/observer/test/client.erl b/lib/observer/test/client.erl
new file mode 100644
index 0000000000..e756f9d6e8
--- /dev/null
+++ b/lib/observer/test/client.erl
@@ -0,0 +1,28 @@
+-module(client).
+-compile(export_all).
+
+init(Node) ->
+ application:start(runtime_tools),
+ net_kernel:connect_node(Node).
+
+init() ->
+ init(server_node()).
+
+restart() ->
+ init:restart().
+
+server_node() ->
+ {ok,HostName} = inet:gethostname(),
+ list_to_atom("server@" ++ HostName).
+
+get() ->
+ erlang:send({server,server_node()}, {get,self()}),
+ receive Data -> Data
+ after 1000 -> no_reply
+ end.
+
+put(Thing) ->
+ erlang:send({server,server_node()}, {put,self(),Thing}),
+ receive ok -> ok
+ after 1000 -> no_reply
+ end.