java.lang.Object
org.springframework.boot.devtools.tunnel.client.TunnelClient
All Implemented Interfaces:
org.springframework.beans.factory.SmartInitializingSingleton

public class TunnelClient extends Object implements org.springframework.beans.factory.SmartInitializingSingleton
The client side component of a socket tunnel. Starts a ServerSocket of the specified port for local clients to connect to.
Since:
1.3.0
  • Constructor Details

    • TunnelClient

      public TunnelClient(int listenPort, TunnelConnection tunnelConnection)
  • Method Details

    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton
    • start

      public int start() throws IOException
      Start the client and accept incoming connections.
      Returns:
      the port on which the client is listening
      Throws:
      IOException - in case of I/O errors
    • stop

      public void stop() throws IOException
      Stop the client, disconnecting any servers.
      Throws:
      IOException - in case of I/O errors
    • getServerThread

      protected final TunnelClient.ServerThread getServerThread()
    • addListener

      public void addListener(TunnelClientListener listener)
    • removeListener

      public void removeListener(TunnelClientListener listener)