Hello! I’ve recently been looking into clients and the like, and was trying to test it out with one of my friends over the internet (Because it tested fine over localhost). The weird thing is that crashes whenever he goes to enter the IP to connect to (Mine). It listens on port 7777, and here’s the code. I have the server and client separate, so they have different github URLs. Here they are:
Server: https://github.com/RyanMB97/ServerStuff/
Client: https://github.com/RyanMB97/ClientStuff
According to the error message my friend sent me, it was somehow related to line 21 in Client, where I create the Socket. Any and all help is appreciated, and thanked in advance!
Thankfully,
-Ryan Mitrun
P.S. Close-Up of problem line(s):
System.out.print("Enter the IP of the server you are connecting to: "); // Ask for the IP
String socketInput = input.nextLine(); // Set the socket IP to whatever they set
System.out.println("Connecting..."); // Connecting to server
socket = new Socket(socketInput, 7777); // Create a socket, connected to the server
P.P.S. The issue was port-forwarding. I just adjusted my router accordingly. Thanks for the help and suggestions anyways!