I'm trying to write an android app that interacts with a server. I'm trying now to write the server side with sockets. I created an instance of ec2 and ran it. I connected to it with putty and ran a simple "hello world" java program. Now I'm trying to run a server which use a socket, but I get this as the server socket: ServerSocket[addr=0.0.0.0/0.0.0.0,localport=5667]. This is my code, very basic so far:
public class EchoServer { public static void main(String[] args) throws IOException { int portNumber = 5667; System.out.println("server socket main"); try (ServerSocket serverSocket = new ServerSocket(portNumber); ) { System.out.println(serverSocket.toString()); } catch (IOException e) { System.out .println("Exception caught when trying to listen on port " + portNumber + " or listening for a connection"); System.out.println(e.getMessage()); } } } What should I do to run the server so I could connect to it via my andriod device?
Thanks!