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 georgeq · Mar 20, 2014 at 11:55 PM · socketsnetwork.connect

How can I connect to an external server using Network.Connect?

I'm trying to figure out the best method to connect my project to the outside world, I started by writing both, the client and the server in Unity, however in the process I learned that I needed a MasterServer in order to make it work, after some research I found the source code of the MasterServer, downloaded it and built it and everything ran OK, but I don't feel comfortable with this solution, mainly because having two related interdependent servers running on the same hardware feels like an unnecessary waste.

So I switched to System.Net.Sockets, and after a while every thing worked fine, however when I tried to build my project for Android, the compiler complaints: "System.Net.Sockets" is only supported on Android Pro... the message is not very clear but I suppose this means I need the "Pro licence", so I moved the server code to a separated project on Visual Studio, and I'm now trying to connect to it, but I just cannot establish the connection with Network.Connect.

The server is running fine, it does accept connections from a test client I wrote, while Unity keeps telling me "The connection request to 192.168.56.1:2500 failed. Are you sure the server can be connected to?"... the accept process on the server is not triggered, meaning no socket connection was received. To discard an error on my code I tested with a remote web server under my control but still get the same message, and the accept process on the remote server is not triggered either. Finally I typed "192.168.56.1:2500" on my web browser and in this case the accept process does get triggered on the my server project, confirming my code is correct... so there must be something weird in the way Network.Connect handles the communication, but can figure out what it is.

Any ideas/advise?

Comment
Add comment · Show 1
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 · Mar 21, 2014 at 04:12 AM 0
Share

What kind of server are you setting up with Sockets Unity's networking system expects a very specific type of server. Generally if you want to use Unity's Networking system you need to use the $$anonymous$$asterServer.

0 Replies

· Add your reply
  • Sort: 

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

21 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 avatar image avatar image avatar image

Related Questions

Does Network.Connect still go through the Master Server? 0 Answers

.NET Sockets in basic iOS/Android license? 1 Answer

websocket and simplejson parsing problem 0 Answers

TCP Socket waiting for ipnut to continiue reading data 0 Answers

Network.Connect() in code without button pressed 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