Skip to content

UDPSimplePacketComs.connectDeviceImp() should return false if exception thrown #11

@javatechs

Description

@javatechs

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions