Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Styn · Aug 01, 2011 at 03:24 PM · networkingnetworkviewtcp

Connecting an external program to a unity server

Hi,

I need to connect a windows forms app to a unity server to retrieve and display data. (Just a little bit of data) I looked around on the unity forums but this doesn't seem possible with unitys networking. I was trying to include the unity DLL and use the networkview and RPC calls. If this is in any way possible could someone point me in the right direction? If this isn't possible I think I'll use .NET tcpclient and tcplistener, but I don't knoz if unity plays nice with those. Maybe someone here has another suggestion?

Comment
Add comment
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

3 Replies

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

Answer by Bunny83 · Aug 01, 2011 at 04:40 PM

You should use "normal" sockets like you already mentioned. The builtin networking is based on Raknet but the version could change in later versions. It's only meant to create connections between Unity applications.

Including the UnityEngine.dll won't help much since it's just a wrapper-dll for the scripting engine. Most of it's functions are directly mapped to the native c++ functions which are part of the Unityplayer (which IS actual the Unity engine).

There should be no problem to start your own tcp sockets along with Unity-networking as long as you use different ports ;)

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
0

Answer by Styn · Aug 04, 2011 at 12:30 PM

I ended up writing my own RPC system over .NET TCP, thanks for the answer!

Comment
Add comment · Show 3 · 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 jorgon · Oct 20, 2011 at 09:43 PM 0
Share

Please, could you send to me your script?. I need to receive data from a C# application and represent it with numbers and plotting in a graph like it's done in the C# and forms applications. I should represent a math graph from a huge vector of pairs of values and additionaly represent the mean of them numerically. I've got to tasks to do and the most important is how to communicate with another computer (PC) for the date receiving apart of the representation graphically and numerically of the data received.

Thanks.

avatar image Bunny83 · Oct 21, 2011 at 03:52 PM 0
Share

Please stop posting such personal questions as answers (esp. not multiple times)! I've converted your last answer into a comment. Don't ask other people to write code for you. You can ask Styn to share his script but one time should be enough. $$anonymous$$ost people want to make money with their work and won't share it. So you could wait for a response from Styn or do it yourself. Writing basic network communication in C# has nothing to do with Unity in the first place.

avatar image jorgon · Oct 21, 2011 at 04:00 PM 0
Share

Sorry. Excuse me please. I'm really new at program$$anonymous$$g and in particular with C# and networking. For me it's like a new world but in my job we need to do something like this. I need to convert the data from an ECG processor in a plotted graph in real time and display the mean in another window. I have never done anything like this and it's very important for me. But excuse because I think that you are making a great job as a moderator/ad$$anonymous$$istrator. This community and forum/section is fantastic and has helped to me in an incredible way till now. I'm sorry very much.

avatar image
0

Answer by simyuan · Mar 07, 2013 at 09:35 PM

Hello! So happy to know you by seeing your post "Connecting an external program to a unity server". In my project, I also need to connect a windows forms app to a unity server to send commond. But I met following problems:

I found that the network function in unity can not work here, so I chose .Net TcpClient/ TcpServer. It worked, but when I loaded another scene, it stoped until I closed unity in task manager of windows. Do you met this situation before?If so, is it means that Using .Net Network function is not a good way for my program?

Then I try to program with Socket. It worked fine when loading new scene. But I found after connecting with server, the windows forms app cannot send massage successfully. The code that receive data in unity was started in a new thread and run in when(true). Is it a right way to wait the data? or Is there any better way to do that?

Please give me some advice if it is convenint. I will give you my code when I am in my work place. Hope to discuss with you about programming in Unity.

I'm looking forward for your reply

Thank you very much!

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

View ID AllocatedID: ### not found during lookup. Strange behaviour may occur 0 Answers

How to send UDP updates form server to each Client? 0 Answers

why if i destroy gameobject in 1st player and the other player is not? 0 Answers

State synchronization non-functional after mode change? 0 Answers

Streaming EEG data from Qstreamer to Unity 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