Selectable is the contract for asynchronous, multi-channel network I/O for NetworkClient.

Selector is the one and only Selectable.

public interface Selectable {
  void connect(String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize) throws IOException;
  void close();
  void close(String id);

  void send(Send send);
  void poll(long timeout) throws IOException;
  void wakeup();

  List<Send> completedSends();
  List<NetworkReceive> completedReceives();

  Map<String, ChannelState> disconnected();
  List<String> connected();

  void mute(String id);
  void unmute(String id);
  void muteAll();
  void unmuteAll();

  boolean isChannelReady(String id);
Table 1. Selectable Contract (in alphabetical order)
Method Description


Used exclusively when NetworkClient is requested to establish a connection to a broker


results matching ""

    No results matching ""