Starting erlang_js properly, and modified python_client tot start two sequential connections

This commit is contained in:
Jonatan Pålsson 2011-02-06 14:43:31 +01:00
parent 79777e7b1c
commit 7267781b64
4 changed files with 8 additions and 5 deletions

View file

@ -52,7 +52,12 @@ data = fs.readline()
print "Token:", token
print "Data: ", ' '.join(data.split(" ")[1:])
s.close()
HOST = 'localhost' # The remote host
PORT = int(sys.argv[1]) # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
# Call that function!
print "Calling myFun"

View file

@ -36,10 +36,6 @@
start_link(Port) ->
gen_server:start_link({local, ?SERVER}, ?MODULE, [Port], []).
start_link(start_as_slave, State) ->
gen_server:start_link({local, ?SERVER}, ?MODULE,
[start_as_slave, State], []).
start_link() ->
start_link(?DEFAULT_PORT).
@ -125,6 +121,7 @@ do_JSCall(Socket, Data, State) ->
{call, Token, Payload} ->
io:format("Got call request: ~p~n", [Payload]),
JSVM = getJSVM(Token, State),
erlang:display(erlang:port_info(JSVM)),
{ok, Ret} = js_runner:call(JSVM, Payload, []),%Payload, []),
send(Socket, Token, "JS says:", binary_to_list(Ret));

View file

@ -3,4 +3,5 @@
start() ->
application:start(inets),
application:start(erlang_js),
application:start(ggs).

2
start
View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash
erl -mnesia -boot start_sasl -pa erlang_js/ebin/ -pa ebin -pa src -s start_ggs
erl -sname ggs -mnesia -boot start_sasl -pa erlang_js/ebin/ -pa ebin -pa src -s start_ggs