Alright, so I’ve got my port forwarded, and I’ve tried it with all firewalls off, and in DMZ mode (All ports open), so It’s not a network problem. I’ve scanned my port with the server running, and the scanner picks up the port, and the server (Thinking it’s a player) prints out that a new player has connected.
The client can connect to the server on localhost, and 127.0.0.1, but not on any global IP. I’ve tried this on multiple networks (Giving friends the server, and client) but to no avail.
So I’m going to post some connection code up, and maybe one of you can tell me whats wrong? Also I’ll post up the client/server pack, in hopes that one of you can get it working, somehow.
Anyway, this really was my last place to ask for help, but I’ve tried this for 2 days now, and asked on SO and the game dev community I frequent.
Also, no, I’m only getting a timeout exception on the client after a little while, no other exceptions.
try {
String ip = JOptionPane.showInputDialog("Please input a IP address");
String port = JOptionPane.showInputDialog("Please input a open port number");
mySocket = new Socket(ip, Integer.valueOf(port).intValue());
fromServer = mySocket.getInputStream();
toServer = mySocket.getOutputStream();
} catch (Exception e) { e.printStackTrace(); }
Edit: forgot the link: https://dl.dropbox.com/u/28109593/cybatar-test.zip