Latest appium in MAC system only starting in 4723 not in other ports

@Priyank_Shah @wreed @p00j4

Appium in MAC system only starting in 4723 not in other ports?

Case: We are starting the appium programatically by setting the node path and appium.js path

Issue: Getting connection refused error after long trying. We are port using

Mac version =10.11 (15A284)
xcode version =Version 7.1 (6E35b)
Appium = Version 1.4.13 (Draco)

anyone faced the issue?

Try to run appium with parameter --port 4327 (or any other port)

I am creating the port using below code:

ServerSocket socket = new ServerSocket(0);
socket.setReuseAddress(true);
port = Integer.toString(socket.getLocalPort());
socket.close();

it working as expected in Windows system. Issue only in the Mac system.

Thanks,
Sanoj