@Test public void canSendMessageToClient() throws IOException { setupWebserverConnection(); sendFirstMessage(); String msg = "Hello client, are you are ok?"; webSocketChannelServer.send(msg); verify(webSocketConnection).send(msg); }
@Override public boolean send(final String message) { if (webSocketConnection != null && webSocketConnection.isConnected()) { sendMessageQueue.onNext(message); return true; } else { return super.send(message); } }
WebSocketChannelServer extends MessengerChannelServer { @Override public boolean send(final String message) { if (webSocketConnection != null && webSocketConnection.isConnected()) { sendMessageQueue.onNext(message); return true; } else { return super.send(message); } } }
WebSocketChannelServer extends MessengerChannelServer { @Override public boolean send(final String message) { if (webSocketConnection != null && webSocketConnection.isConnected()) { sendMessageQueue.onNext(message); return true; } else { return super.send(message); } } WebSocketChannelServer(Context context, String serviceComponentName, String clientPackageName); }
WebSocketChannelServer extends MessengerChannelServer { @Override public boolean send(final String message) { if (webSocketConnection != null && webSocketConnection.isConnected()) { sendMessageQueue.onNext(message); return true; } else { return super.send(message); } } WebSocketChannelServer(Context context, String serviceComponentName, String clientPackageName); @Override void handleMessage(Message msg); @Override boolean send(final String message); @Override boolean sendEndStream(); }
WebSocketChannelServer extends MessengerChannelServer { @Override public boolean send(final String message) { if (webSocketConnection != null && webSocketConnection.isConnected()) { sendMessageQueue.onNext(message); return true; } else { return super.send(message); } } WebSocketChannelServer(Context context, String serviceComponentName, String clientPackageName); @Override void handleMessage(Message msg); @Override boolean send(final String message); @Override boolean sendEndStream(); static final String CONNECT_PLEASE; static final String CLOSE_MESSAGE; }