Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 sdgd · Aug 21, 2013 at 11:34 AM · c#clientportingfrom

unity client is acessing from what port? (what port to set in router)

I'm trying to configure out the router we have at our house but I've came to a problem, I thought I only need to give it port from witch I'm receiving the messages, but now I see I need to give it port from what I will receive messages as well, ...

so, ... what should I choose? other applications? or...? alt text

and that what should I give for from port? through port is probably 25001 and so is to port. right?

Server Script:

     public int Port = 25001;
 
     void Start(){
         Network.InitializeServer(10, Port);
     }


Client Script:

     public string IP = "31.15.149.40"; // server IP
     public int Port = 25001; // Open Port to server
 
     void Start (){
         Network.Connect(IP, Port);
     }

alt text

and at protocol I should use TCP right?

there are options:

  • TCP

  • UDP

  • ESP

  • GRE

thanks in advance

port forwarding1.jpg (105.0 kB)
port forwarding.jpg (99.5 kB)
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 Benproductions1 · Aug 22, 2013 at 11:06 PM 1
Share

Unity Networking uses UDP (even though it probably shouldn't)

avatar image Benproductions1 · Aug 22, 2013 at 11:07 PM 0
Share

Also Unity uses standardised protocols to automatically open ports. Usually you don't need to do port forwarding. Have you tried without?

avatar image sdgd · Aug 23, 2013 at 12:46 PM 0
Share

well without would than mean for to router to send the data to all 10 computers in our house, ... and no it didn't work without.

BUT now I even know I must set them all alike.

even understand a bit more thanks to the answerer. Thought that client is trying to access 25001 on some else port.

NOW I know If I do it this way:

client

 Network.Connect(IP, 20);

Server

 Network.InitializeServer(10, 25001);

that I have to configure fritz box to forward port from 20 in to the port 25001.

and everything will work fine :)

thanks community on the hard subject networking.

1 Reply

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

Answer by Slobdell · Aug 22, 2013 at 11:17 PM

Yes UDP. The from port is the port you're expecting to receive on. The to port should probably just be the same. But what it's asking you is if you want to change the port along the way.

External application --> Router IP/Port --> destination in network IP/Port

If you wanted you could say any requests coming in the router on port 1, can be forwarded on to another machine at port 2. But in your case just keep them all the same since the server is listening on 25001 and the client is is trying to connect on 25001

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

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.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Networking how to return data? OR how to send only to 1 client 1 Answer

Combine two scripts 0 Answers

GC collects variable that is still in use 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