Handle more specific BindException and IOException 77/13177/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 27 Nov 2014 20:22:54 +0000 (15:22 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 1 Dec 2014 21:41:25 +0000 (16:41 -0500)
It is good pratice to handle specific exceptions rather than using the
catch all generic Exception.

This code change handles the java.net.BindException such that if an port
is already in use we skip creating the simulated device on that port.

IOException will display the failure message and exception and not cause
additional attempts.

Change-Id: I7cbf3aa7016b0589f8fdd3f6476006954068a9a0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>

No differences found