• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Hunter4854 · Dec 06, 2013 at 07:33 PM · c#networkingnetworkservermasterserver

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?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hunter4854 · Dec 06, 2013 at 11:17 PM 0
Share

What do you mean? that is an IP address, not a port?

avatar image Vitorino · Dec 06, 2013 at 11:27 PM 0
Share

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.

avatar image Hunter4854 · Dec 06, 2013 at 11:33 PM 0
Share

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?

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Hunter4854 · Dec 11, 2013 at 10:39 PM

Actually, for some reason, when i added Network.InitializeSecurity();

before it, it worked.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Agnostic · Nov 01, 2014 at 04:07 PM 0
Share

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.

avatar image Bunny83 · Nov 01, 2014 at 04:37 PM 0
Share

@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.

avatar image
1

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
-4

Answer by Vitorino · Dec 06, 2013 at 11:16 PM

Instead of using port 25001 try to use 127.0.0.1

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hunter4854 · Dec 06, 2013 at 11:19 PM 0
Share

That is an IP address NOT a port...

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 3D Networking questions (About master servers) 1 Answer

Unity networking tutorial? 6 Answers

Best way to handle Sockets? 0 Answers

Creating servers properly? 0 Answers

FPS drops to 30 when I use MasterServer.RegisterHost, WHY!? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges