Unable to connect to server. Cannot find free port to use.
by BetaSteward
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
Re: Unable to connect to server. Cannot find free port to us
by sipes1946 » 03 Aug 2015, 02:45
exact same problem and solution (uninstalled AVG)LevelX wrote:Thanks for the reply with the cause of your problem.Armyn3 wrote:I found the problem. It did not help if I disabled AVG antivirus, but worked after I completely deleted it from my laptop. Might be the case with other antivirus programmes as well.
Re: Unable to connect to server. Cannot find free port to us
by Renaan » 23 Feb 2016, 20:35
Well, since the update to 1.4.9 this problem has been hitting me.
Also downloads the cards, but doesn't store them, or maybe its just failing to download them altogether.
Have exceptions added to firewall, although that was never needed in 1.4.8
Feb 23, 2016 8:25:09 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
That's the first thing that pops up on the XMage Client Console.
Java is confirmed as latest version as 1.7.0_75
Please help
Also downloads the cards, but doesn't store them, or maybe its just failing to download them altogether.
Have exceptions added to firewall, although that was never needed in 1.4.8
Feb 23, 2016 8:25:09 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
That's the first thing that pops up on the XMage Client Console.
Java is confirmed as latest version as 1.7.0_75
Please help

- Renaan
- Posts: 6
- Joined: 01 Dec 2015, 22:59
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by LevelX » 23 Feb 2016, 21:08
Your system seems to restrict your profile access to the windows registry in a special way.Renaan wrote:Well, since the update to 1.4.9 this problem has been hitting me.
Also downloads the cards, but doesn't store them, or maybe its just failing to download them altogether.
Have exceptions added to firewall, although that was never needed in 1.4.8
Feb 23, 2016 8:25:09 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
That's the first thing that pops up on the XMage Client Console.
Java is confirmed as latest version as 1.7.0_75
Please help
Maybe this workaround described under the following link does help you:
http://www-01.ibm.com/support/docview.w ... wg21496098
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Unable to connect to server. Cannot find free port to us
by Renaan » 23 Feb 2016, 21:45
Hi There
Ok, so checking registry....
I have keys for Xmage in CurrentUser-Software-JavaSoft-Prefs-Mage
I made a key Local_Machine -Software-Javasoft-Prefs
I do not really know enough about editing registery to know that its 100% right, but they look the same.
it didn't help
I'm still unable to connect to server, still saying Can not find a free port for use.
(Edit)
I'm on Windows 10 64bit btw
Ok, so checking registry....
I have keys for Xmage in CurrentUser-Software-JavaSoft-Prefs-Mage
I made a key Local_Machine -Software-Javasoft-Prefs
I do not really know enough about editing registery to know that its 100% right, but they look the same.
it didn't help

I'm still unable to connect to server, still saying Can not find a free port for use.
(Edit)
I'm on Windows 10 64bit btw
- Renaan
- Posts: 6
- Joined: 01 Dec 2015, 22:59
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by LevelX » 24 Feb 2016, 09:14
And AVG or a similar isn't installed?Renaan wrote:I'm still unable to connect to server, still saying Can not find a free port for use.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Unable to connect to server. Cannot find free port to us
by Renaan » 24 Feb 2016, 14:34
yep, using AVG, but I was using AVG on 1.4.8 and everything worked fine.
This all started when it updated to 1.4.9
This all started when it updated to 1.4.9
- Renaan
- Posts: 6
- Joined: 01 Dec 2015, 22:59
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by LevelX » 24 Feb 2016, 15:49
So be sure it's caused by AVG that is blocking the ports.
XMage can't do anything about it.
XMage can't do anything about it.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Unable to connect to server. Cannot find free port to us
by Renaan » 24 Feb 2016, 20:34
Ok, so I can now connect to the server, but cannot download any of the card images, but symbols were downloaded fine.
Unexpected end of file from server for every card as the error message, Java SocketException.
Unexpected end of file from server for every card as the error message, Java SocketException.
- Renaan
- Posts: 6
- Joined: 01 Dec 2015, 22:59
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by ggzel » 14 Jan 2017, 16:30
I am having the same problem, although XMage has never worked for me. I can make a deck in the deck builder screen, but it won't let me connect to any server, giving me this error (Can not find a free port to use). Please help, this looks like a really good and fun program, and I would like to be able to use it. I do not have AVG installed, by the way.
- ggzel
- Posts: 1
- Joined: 14 Jan 2017, 16:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by skywalk » 20 Jan 2017, 01:25
Hi this is how i setup my server, using a hostname.
I forwarded the port 17171 and 17172 to my 192.168.0.2 computer where my xmage server is open on my router config webpage (usually at http://192.168.0.1 or 1.1)
I added this line at the bottom of the file my c:\windows\system32\drivers\etc\hosts
I forwarded the port 17171 and 17172 to my 192.168.0.2 computer where my xmage server is open on my router config webpage (usually at http://192.168.0.1 or 1.1)
I added this line at the bottom of the file my c:\windows\system32\drivers\etc\hosts
- Code: Select all
192.168.0.2 xmage.lukeskywalk.com
- Code: Select all
<server serverAddress="xmage.lukeskywalk.com"
serverName="mage-server"
port="17171"
secondaryBindPort="17172"
backlogSize="800"
numAcceptThreads="4"
maxPoolSize="1000"
leasePeriod="12000"
maxGameThreads="70"
maxSecondsIdle="600"
minUserNameLength="3"
maxUserNameLength="14"
invalidUserNamePattern="[^a-z0-9_]"
minPasswordLength="8"
maxPasswordLength="100"
maxAiOpponents="15"
saveGameActivated="false"
authenticationActivated="false"
googleAccount=""
mailgunApiKey=""
mailgunDomain=""
mailSmtpHost=""
mailSmtpPort=""
mailUser=""
mailPassword=""
mailFromAddress=""
/>
Re: Unable to connect to server. Cannot find free port to us
by skywalk » 20 Jan 2017, 01:38
oh and backup your config.xml file elsewhere because when you update your xmage installation it delete and erase your config.xml file.
Re: Unable to connect to server. Cannot find free port to us
by kelmhike » 23 Jan 2017, 16:42
Hi, since i have updated my xmage, it doesnt work right now, it shows that i am not connected. i have restarted everything, tried new server list, still not connected
thanks in advance for the help
thanks!
thanks in advance for the help
thanks!
- kelmhike
- Posts: 2
- Joined: 23 Jan 2017, 16:33
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by kohath » 22 Aug 2017, 14:55
I am having the same issues, but I am running Mac OSX 10.12.6. There is no Firewall to be an issue and no workaround that I can see. I am not a programmer and have never written code a day in my life. I played Xmage without issue on my Mac 6 months ago, but as I try to log back on, it is freezing me out with this prompt.
Any thoughts?
Any thoughts?
- kohath
- Posts: 5
- Joined: 22 Aug 2017, 14:53
- Has thanked: 0 time
- Been thanked: 0 time
Re: Unable to connect to server. Cannot find free port to us
by kohath » 22 Aug 2017, 19:43
Solved.
For me it had nothing to do with my personal settings on my computer, but the router at my location. I am not currently at home, but visiting family and found that they have a firewall within their router that I needed my computer to bypass. Once I found this the work around was simple enough.
K
For me it had nothing to do with my personal settings on my computer, but the router at my location. I am not currently at home, but visiting family and found that they have a firewall within their router that I needed my computer to bypass. Once I found this the work around was simple enough.
K
- kohath
- Posts: 5
- Joined: 22 Aug 2017, 14:53
- Has thanked: 0 time
- Been thanked: 0 time
29 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 2 guests