Hello guys,
Thanks for a great SDK! I am working on a voxel kind of project and my goal is to make it Multiplayer as that plays a big part in my game.
So I tried creating a server using SpiderMonkey, I guess, with the following code;
Server myServer = Network.createServer(6143);
myServer.start();
But it would not compile, telling me about surrounding it with Try and Catch statements. So I did. Ended up with;
try {
Server myServer = Network.createServer(6143);
myServer.start();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
This compiled, so I tried creating a client, it it was the same story. I had to surround with Try and Catch like this;
try {
Client myClient = Network.connectToServer("90.129.144.158", 6143);
myClient.start();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
After this I try running it and the console told me the connection was timed out. Is that because I am trying to join a TCP game where I am the host?
If so, will it work if someone else plays the game, or did I miss a thing or two?
The log from the console told me this;
INFO: Kernel started for connection:0.0.0.0/0.0.0.0:6143.
2011-okt-30 14:06:13 mygame.Main simpleInitApp
SERIOUS: null
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.(Socket.java:372)
at java.net.Socket.(Socket.java:215)
at com.jme3.network.kernel.tcp.SocketConnector.(SocketConnector.java:62)
at com.jme3.network.Network.connectToServer(Network.java:166)
at com.jme3.network.Network.connectToServer(Network.java:123)
at mygame.Main.simpleInitApp(Main.java:62)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:230)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
at java.lang.Thread.run(Thread.java:619)
What is up with the IP set to 0.0.0.0? Any help is appreciated.
- Lars.