- Home /
communicate between Unity and a Windows exe?
I need to communicate between my Unity project and a Windows executable running on the same PC.
The Windows exe needs to send simple messages to the Unity application, and the Unity application needs to send simple messages to the Windows exe.
What's the best way to do this? Named pipes? Windows Messaging? Sockets? UDP? Something else?
Sample code or tutorials would be awesome (I'm new to unity and C#)
Hi! Did you ever find a solution to this?,Hi! Did you ever find a solution to this?
sockets its a fairly easy way of doing it but not sure if "the best" but i can maybe help you if you want to do it like that
Answer by xamomax · Mar 13, 2019 at 03:59 PM
@christianeide - Yes. We ended up using TCP/IP, sending JSON strings back and forth.
That seemed to be quite good performance-wise (at least good enough for our needs.) It's also expandable should we want to talk to other computers on the network, etc.
(using Sockets, as @xxmariofer mentions)
Thank you for your quick answer! Will try a socket solution!
Your answer
![](https://koobas.hobune.stream/wayback/20220612090001im_/https://answers.unity.com/themes/thub/images/avi.jpg)