Class TunnelClient
java.lang.Object
org.springframework.boot.devtools.tunnel.client.TunnelClient
- All Implemented Interfaces:
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
- Author:
- Phillip Webb, Andy Wilkinson
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
The main server thread. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TunnelClientListener listener) void
protected final TunnelClient.ServerThread
void
removeListener
(TunnelClientListener listener) int
start()
Start the client and accept incoming connections.void
stop()
Stop the client, disconnecting any servers.
-
Constructor Details
-
TunnelClient
-
-
Method Details
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiated
in interfaceSmartInitializingSingleton
-
start
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
Stop the client, disconnecting any servers.- Throws:
IOException
- in case of I/O errors
-
getServerThread
-
addListener
-
removeListener
-