program
program
communication for client and server. both can run in the same machine or different
machines
import java.io.*;
import java.net.*;
// Close connections
clientSocket.close();
serverSocket.close();
System.out.println("Server disconnected.");
} catch (IOException e) {
e.printStackTrace();
}
}
}
2..
import java.io.*;
import java.net.*;
// Close connection
socket.close();
System.out.println("Connection closed.");
} catch (IOException e) {
e.printStackTrace();
}
}
}