Adding unit test for bootstrap.
Added unit test case for bootstrap.
Re factored bootstrap.
Scan port before connection in bootstrap.