I have a TCPIP client with following code.
I want to catch specific exceptions for Port and for hostname. Please advice.Code:try {
smtpSocket = new Socket("javabook", 22122);
os = new DataOutputStream(smtpSocket.getOutputStream());
is = new DataInputStream(smtpSocket.getInputStream());
} catch (Exception ex) {
System.out.println("Some error has occured");
}
