Hello! I am completely new to JavaRanch? (or is it CodeRanch? or Big Moose Saloon?) and I am also new to NIO.
I am programming this card playing game and I decided to use NIO for the sole reason that I didn't want hundreds of threads.
I ended up making it single threaded (using selectNow, is this a bad thing) for 2 reasons:
- multithreading is a pain
- I'm using LWJGL which most of the methods only work on the main thread
But I am getting this error when I run the program twice, one hosting and the other one connecting to my IP:
My code is hosted on Github at
https://github.com/matanui159/Card-Player/tree/no-engine.
Some more information:
- I have googled it and apparently it happens either when the port Isn't used or the "backlog queue" is full, which happens when alot of clients are connecting, but only one client is connecting and both the client and the server share a common port (at NetConstants.PORT = 22737)
- It still works when I use the loopback address (127.0.0.1)
- when I try to connect from another computer (on LAN still) I get a timeout error instead
Can someone please help me. If there is any information I forgot or I'm breaking one of the rules, let me know, and I will fix.
Thanks in advance.