Mercurial > hg > Members > tatsuki > Alice
changeset 218:d50cddf64396 working
TestRemoteAlice works
author | sugi |
---|---|
date | Wed, 27 Mar 2013 20:35:08 +0900 |
parents | b5c642ba998e |
children | 9fe7afd7d292 |
files | src/alice/codesegment/InputDataSegment.java src/alice/daemon/AliceDaemon.java src/alice/daemon/OutboundTcpConnection.java src/alice/test/codesegment/remote/TestRemoteAlice.java |
diffstat | 4 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/codesegment/InputDataSegment.java Wed Mar 27 20:02:38 2013 +0900 +++ b/src/alice/codesegment/InputDataSegment.java Wed Mar 27 20:35:08 2013 +0900 @@ -59,10 +59,12 @@ public void reply(Receiver receiver, Command reply) { receiver.index = reply.index; receiver.from = reply.reverseKey; - if (!reply.reverseKey.equals("local")) { + if (reply.reverseKey==null){ + receiver.setData(new ReceiveRemoteData(reply.val)); + } else if (!reply.reverseKey.equals("local")) { receiver.setData(new ReceiveRemoteData(reply.val)); } else { - receiver.setData(new ReceiveLocalData(reply.obj)); + receiver.setData(new ReceiveLocalData(reply.obj)); } receive(); }
--- a/src/alice/daemon/AliceDaemon.java Wed Mar 27 20:02:38 2013 +0900 +++ b/src/alice/daemon/AliceDaemon.java Wed Mar 27 20:35:08 2013 +0900 @@ -53,7 +53,6 @@ ss.bind(a); acceptThread = new AcceptThread(ss, "ACCEPT" + conf.localPort); acceptThread.start(); - } catch (IOException e) { e.printStackTrace(); }
--- a/src/alice/daemon/OutboundTcpConnection.java Wed Mar 27 20:02:38 2013 +0900 +++ b/src/alice/daemon/OutboundTcpConnection.java Wed Mar 27 20:35:08 2013 +0900 @@ -15,6 +15,13 @@ } public CommandMessage convert(Command cmd) { + if (cmd.val==null&&cmd.obj!=null){ + try { + cmd.val = SingletonMessage.getInstance().unconvert(cmd.obj); + } catch (IOException e) { + e.printStackTrace(); + } + } return new CommandMessage(cmd.type.id, cmd.index, cmd.seq, cmd.key, cmd.val); }
--- a/src/alice/test/codesegment/remote/TestRemoteAlice.java Wed Mar 27 20:02:38 2013 +0900 +++ b/src/alice/test/codesegment/remote/TestRemoteAlice.java Wed Mar 27 20:35:08 2013 +0900 @@ -10,7 +10,6 @@ new AliceDaemon(conf).listen(); DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort); - new RemoteStartCodeSegment().execute(); }