Class BoundSocketMaker

java.lang.Object
org.apache.hadoop.hbase.net.BoundSocketMaker
All Implemented Interfaces:
Closeable, AutoCloseable

public final class BoundSocketMaker extends Object implements Closeable
Utility to generate a bound socket. Useful testing for BindException. Use one of the Constructors to create an instance of this class. On creation it will have put up a ServerSocket on a random port. Get the port it is bound to using getPort(). In your test, then try to start a Server using same port to generate a BindException. Call close() when done to shut down the Socket.