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
1
Question by Guardian2300 · Dec 12, 2013 at 04:18 PM · c#networkingsocket

Unity C# Sockets?

Hello everyone, I assuming this question has already been answered and I can't seem to find it. How would one go at creating a offline LAN using the c# sockets, is there any tutorials? Any help would be greatly appreciated.

Comment
Add comment · Show 6
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 Malapropos · Dec 12, 2013 at 04:26 PM 1
Share

Is there any particular reason you want to use raw sockets ins$$anonymous$$d of Unity built-in networking or some other higher level networking solution?

avatar image Guardian2300 · Dec 12, 2013 at 04:31 PM 0
Share

I'm trying to design the game to where you can connect to each others computer without the need of internet. Example would be like system linking between consoles

avatar image Guardian2300 · Dec 12, 2013 at 04:50 PM 0
Share

how would you start the server then, would you use network.initializeserver and the local network ip would be the one displayed on computer using ipconfig in cmd?

avatar image Malapropos · Dec 12, 2013 at 05:01 PM 0
Share

Yes, that should work. I've tested same kind of setup within local university network. If you can access the router config you should be able to see which IP it has assigned to which machine that way too.

avatar image Guardian2300 · Dec 12, 2013 at 05:06 PM 0
Share

Now if I bought a router and didn't hook it up to the internet and had everyone just hook up to the router would that work too. This is also for a College purpose and avoiding the schools network

Show more comments

2 Replies

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

Answer by Malapropos · Dec 12, 2013 at 04:42 PM

Are the machines in network with each of them having assigned IP address? If so, you could just use Unity built in networking and there is no need to go so low level as raw sockets.

Some good material that helped me get started with Unity networking:

http://www.palladiumgames.net/tutorials/unity-networking-tutorial/

http://docs.unity3d.com/Documentation/Components/NetworkReferenceGuide.html

http://cgcookie.com/unity/2011/12/20/introduction-to-networking-in-unity/

Just use local network IP instead of public one that is shown to the outside world.

Comment
Add comment · Show 4 · 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 Guardian2300 · Dec 12, 2013 at 06:21 PM 0
Share

also going to ask this if others might have this issue but is the facilitator unity embedded, cause I create the offline server and it says connect to facilitator at xx.xxx.xxx.xx port. would I have others connect to this ip address?

avatar image Guardian2300 · Dec 12, 2013 at 07:21 PM 0
Share

I am having issues with it being offline. I can't get clients to connect to the IpAddress associated with Network.player.Ipaddress. I keep getting an error about the connection request to ip address and port failed are you sure the server can be connected to. I'm not connecting to the server I'm creating my own

avatar image Malapropos · Dec 12, 2013 at 07:26 PM 0
Share

If your connection details are all correct it should connect without problems. Can you show some of your code?

avatar image Guardian2300 · Dec 12, 2013 at 07:57 PM 0
Share

Never$$anonymous$$d to note if the useNat is set to true then it searches on unity servers for the facilitator which results in the connection not working. I got it to work. Thanks very much

avatar image
-1

Answer by watsonsimler · Jun 02, 2014 at 07:24 AM

A simple socket programming example in c# for beginners....C# Socket programming

Watson

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

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

Distribute terrain in zones 3 Answers

Need help - Socket Server always connects to port 80 2 Answers

Data keeps "hanging". TCP client/server 2 Answers

Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference 0 Answers

Cannot connect to Unity3D master server from another device(computer) 0 Answers


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