- Home /
Port not opening?
Hello, i am relatively new to Unity, so hopefully this is not a dumb question. I am using this to create a server on the client:
Network.InitializeServer(32, 25001, !Network.HavePublicAddress());
For some reason when i go to an online port checker, and i type in port 25001, i get an error saying it is closed. This also is why my server can not be seen on the master server...I think. All examples i follow lead to the same issue.
The server is registered, but i do not get that the server is online. Why is the port not opening? I have disabled my firewall and port-forwarded port 25001.
Also, could i use a linux server (with no UI) to run a game server?
Sorry did not watch it was door. You have to use port 25000 and not 25001. Sought and took a few sites in Portuguese of Brazil and found an explanation of how to make the server on the client machine.
Why does it matter what port i use? If that is the only port i can use, then why does unity allow me to pick one?
Answer by Hunter4854 · Dec 11, 2013 at 10:39 PM
Actually, for some reason, when i added Network.InitializeSecurity();
before it, it worked.
This is not working for me, the port still closed, but if I run an HTTP server on the same port, the port is open and I can access from internet.
@Agnostic:
Are you sure that the port isn't used by a different application? Every port on a PC can only be used by one application at a time.
Some things you might want to check:
Can you connect locally to your server when using localhost / 127.0.0.1?
If you can, it's most likely a router / firewall problem. If you can't the server somehow can't be started or it's blocked by your firewall.
The HTTP uses TCP while Unity / Raknet uses UDP. $$anonymous$$ake sure you port-forwarded the correct protocol. In most cases you simply forward both.
I know that some routers do not allow local loopback connections. That means the whole world can connect to you, but you can't connect to yourself. That's extremely annoying (i know that because my ISP gave me such a router...) but you can't do anything about that besides using a different router.
Answer by WoflenGames · Dec 08, 2013 at 07:56 PM
Is your Port Forward placed on Right IP of the router? otherwise it will still block
Your answer
Follow this Question
Related Questions
Best way to handle Sockets? 0 Answers
Creating servers properly? 0 Answers
FPS drops to 30 when I use MasterServer.RegisterHost, WHY!? 1 Answer
Simple dedicated server on the VDS 1 Answer
Unity 3D Networking questions (About master servers) 1 Answer