If instantiation of a DatagramSocket fails and an exception is throw, shouldn't the exception handling code return 'false' since it won't be connected?
public boolean connectDeviceImp() {
try {
if(listening)
udpSock = new DatagramSocket(port);
else
udpSock = new DatagramSocket();
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}