Class STATE_SOCK

  • All Implemented Interfaces:
    ProcessingQueue.Handler<Address>

    public class STATE_SOCK
    extends StreamingStateTransfer
    STATE_SOCK has the state provider create a server socket to which the state requester connects and from which the latter reads the state.

    When implementing StateListener.getState(java.io.OutputStream), the state should be written in sizeable chunks, because the underlying output stream sends 1 message / write over the socket. So if there are 1000 writes of 1 byte each, this would generate 1000 messages ! We suggest using a BufferedOutputStream over the output stream handed to the application as argument of the callback.

    When implementing the StateListener.setState(java.io.InputStream) callback, there is no need to use a BufferedOutputStream, as the input stream handed to the application already buffers incoming data internally.

    Since:
    3.0
    Author:
    Vladimir Blagojevic, Bela Ban
    See Also:
    STATE_TRANSFER
    • Field Detail

      • bind_addr

        protected java.net.InetAddress bind_addr
      • external_addr

        protected java.net.InetAddress external_addr
      • external_port

        protected int external_port
      • bind_interface_str

        protected java.lang.String bind_interface_str
      • bind_port

        protected int bind_port
      • spawner

        protected volatile STATE_SOCK.StateProviderAcceptor spawner
        Runnable that listens for state requests and spawns threads to serve those requests if socket transport is used
    • Constructor Detail

      • STATE_SOCK

        public STATE_SOCK()