I have made a very simple command chat java base application.
Although the Project is consist of one being functioning as the Server and the other one being the Client which sends Sockets and receive Sockets from the Server.
But the Server is not a Servlet or any other kind, it's just a simple plain java class that function as a server via ServerSocket...
If it can be hosted online (cloud preferably) how will I know the new hostname for the Client to use??? Will the port change to???
Server class
public class ServerDoor {
public static void main(String args[]) throws IOException {
final int portNumber = 81;
ServerSocket serverSocket = new ServerSocket(portNumber);
while (true) {...}
}
}
Client Side
public static void main(String args[]) throws IOException {
final String host = "localhost"; // the host name!
final int portNumber = 81;
System.out.println("Creating socket to '" + host + "' on port " + portNumber);
while (true) {...}
}