@Override public void receive(AbstractPacket abstractPacket, String senderIdentifier) { if (abstractPacket instanceof PingPacket) { received = true; testBridgeObserver.serverReceived(abstractPacket, senderIdentifier); try { PongPacket pongPacket = new PongPacket(); serviceProxyBase.sendPacket(pongPacket, senderIdentifier); sendCallbackCnt++; sent = true; testBridgeObserver.serverSent(pongPacket, senderIdentifier); } catch (Exception e) { } } }
/** * Initialize test service on given port. * * @param port * @throws BridgeException */ public void initialize(int port) throws BridgeException { serviceProxyBase.initialize(port, this); }