final ObjectSpace serverObjectSpace = new ObjectSpace();
final TestObjectImpl serverTestObject = new TestObjectImpl(4321);
serverObjectSpace.register((short)42, serverTestObject);
server.addListener(new Listener() {
public void connected (final Connection connection) {
serverObjectSpace.addConnection(connection);
runTest(connection, 12, 1234);
}
public void received (Connection connection, Object object) {
if (!(object instanceof MessageWithTestObject)) return;
MessageWithTestObject m = (MessageWithTestObject)object;
System.out.println(serverTestObject.value);
System.out.println(((TestObjectImpl)m.testObject).value);
assertEquals(4321f, m.testObject.other());
stopEndPoints(2000);
}
});
// ----
Client client = new Client();
register(client.getKryo());
ObjectSpace clientObjectSpace = new ObjectSpace(client);
final TestObjectImpl clientTestObject = new TestObjectImpl(1234);
clientObjectSpace.register((short)12, clientTestObject);
startEndPoint(client);
client.addListener(new Listener() {
public void connected (final Connection connection) {
RmiTest.runTest(connection, 42, 4321);
}
public void received (Connection connection, Object object) {