- Home /
Server initialization not accepting connections.
Hello,
I've been cracking my head over this problem for a few days now, and was wondering if anyone saw anything like this before.
So, I'm running this server using Unity's networking, and if I'm trying to connect to it on a client using a local IP then everything works and there are no problems. The problems start when I'm trying to connect over an external IP, to which I'm dealt the lovely "The connection request to X.X.X.X:X failed. Are you sure the server can be connected to?".
Now, the weird thing is, I've forwarded all my ports and they seem to be working fine when I check with PFPortChecker(Which basically checks if a port is forwarded, regardless of if a server is currently listening to it on your computer, it does that by creating a server of its' own and listening to the wanted port), but when I try to check my server's visibility on canyouseeme.org, it says that it can't see it, as in, no server is listening to connections on that port, even though my server IS running.
Here's where it gets even weirder though; Since PFPortChecker sets up a server listening to that port, if I check the port on canyouseeme.org while that server is running, it returns a positive, the server is seen.
This basically leads me to think: 1. My ports are forwarded correctly and my network is setup fine. 2. There's something wrong with my server itself.
The Network's initialization code is simply:
NetworkConnectionError err = Network.InitializeServer(9, port, !Network.HavePublicAddress());
Debug.Log(err.ToString());
To which the error just returns NoError.
I'm at a real loss to what this could be, it's not like there's much to go wrong with on that simple piece of code...
Well, I'd be thankful for any information anyone could find. Thanks alot.
Your answer
![](https://koobas.hobune.stream/wayback/20220613173536im_/https://answers.unity.com/themes/thub/images/avi.jpg)