Giter VIP home page Giter VIP logo

unity-named-pipes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unity-named-pipes's Issues

How to use this repo?

If I want to communicate between Unity and a process in another language (e.g. python, C++) how can I do it?

Unix implementation sockets are not closed when the socket path failed to connect or does not exist

This causes specifically with the https://github.com/Lachee/discord-rpc-csharp library for games built with unity to crash on linux as they reach the max number of open file descriptors because of all of the dangling sockets:

I built a simple C++ program to reproduce this behavior https://gist.github.com/mdsitton/95fc0040d01cdf198961cb72255c234a:

NamedPipe 24436 deck  154u     unix 0x0000000032901640      0t0 1758654 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  155u     unix 0x00000000d5c3a1e9      0t0 1758660 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  156u     unix 0x00000000683a598f      0t0 1758661 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  157u     unix 0x00000000c55ccb76      0t0 1758662 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  158u     unix 0x00000000014525f2      0t0 1758663 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  159u     unix 0x00000000d50b286d      0t0 1758664 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  160u     unix 0x00000000e67ac18d      0t0 1758665 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  161u     unix 0x00000000b56c7489      0t0 1758666 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  162u     unix 0x000000005ec439e0      0t0 1758667 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  163u     unix 0x0000000048697d99      0t0 1758668 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  164u     unix 0x00000000134ceea6      0t0 1758669 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  165u     unix 0x00000000d28c99e8      0t0 1758673 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  166u     unix 0x0000000077915d8f      0t0 1758674 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  167u     unix 0x000000005b9e8cf4      0t0 1758675 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  168u     unix 0x00000000427a36ff      0t0 1758676 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  169u     unix 0x00000000a20791de      0t0 1758677 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  170u     unix 0x00000000fea049c2      0t0 1758678 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  171u     unix 0x0000000096185ac3      0t0 1758679 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  172u     unix 0x00000000095ce08f      0t0 1758680 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  173u     unix 0x000000008790cba8      0t0 1758681 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  174u     unix 0x000000000c4dd30c      0t0 1758682 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  175u     unix 0x00000000d8bd7810      0t0 1758688 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  176u     unix 0x00000000b0c390bf      0t0 1758689 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  177u     unix 0x0000000073576f72      0t0 1758690 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  178u     unix 0x00000000d50b8cda      0t0 1758691 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  179u     unix 0x0000000078206672      0t0 1758692 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  180u     unix 0x00000000ea085407      0t0 1758693 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  181u     unix 0x00000000720ba526      0t0 1758694 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  182u     unix 0x00000000f357ca4e      0t0 1758695 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  183u     unix 0x00000000784fe663      0t0 1758696 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  184u     unix 0x000000002008e488      0t0 1758697 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  185u     unix 0x00000000390b7635      0t0 1758702 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  186u     unix 0x00000000e8415e72      0t0 1758703 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  187u     unix 0x00000000fcddf6dd      0t0 1758704 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  188u     unix 0x0000000062727928      0t0 1758705 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  189u     unix 0x00000000fa2d3c4a      0t0 1758706 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  190u     unix 0x00000000a7262f67      0t0 1758707 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  191u     unix 0x00000000cac478ad      0t0 1758708 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  192u     unix 0x000000009f51dda5      0t0 1758709 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  193u     unix 0x0000000070f71bcb      0t0 1758710 type=STREAM (UNCONNECTED)
NamedPipe 24436 deck  194u     unix 0x00000000f631da32      0t0 1758711 type=STREAM (UNCONNECTED)
(deck@steamdeck ~)$ lsof -p 24436 | grep -c STREAM
270

The issue occurs here:
https://github.com/Lachee/unity-named-pipes/blob/master/UnityNamedPipe.Native/connection_unix.cpp#L97

This happens because isOpened is only set to true if a connection is made to the input path, but we still have a socket which doesn't get closed properly.

System.DLLNotFoundException: NativeNamedPipe on MaxOSX

I have problem using this plugin with unity. After compilation of the game, there are no plugin (NativeNamedPipe.so) in /Contents/Frameworks/MonoEmbedRuntime/osx/ directory. Plugin code in unity in /Assets/Plugins/x86_64 directory. So on launch, game crushed with System.DLLNotFoundException: NativeNamedPipe error. "Fallback handler could not load library".
Because library is just missing.

MacOS Support

The plugin included for Unix is a .so file but Unity requires a .bundle file for Mac OS:

For cross platform plug-ins you must include the .bundle (for Mac), .dll (for Windows), and .so (for Linux) files in the Plugins folder. No further work is then required on your side - Unity automatically picks the right plug-in for the target platform and includes it with the player.

I don't need a Mac build bad enough to create a bundle right now, just leaving this here for anyone else that runs into the issue.

Originally posted by @jelling in #2 (comment)

Is this package working?

It shows build failing and there are no instructions on how to actually use the package. Just curious if it is fully functional, or still in development phase?

Just want to say thanks, still not fixed in Unity.

It looks like pipes do work, but its more because mono never finished async implementation in the pipes. I have a .NET 5 server that runs a Unity instance and the server works fine using async but have to use Hard Threads or your library to get it to work on unity's side. I was about to give up and just use TcpClient/TcpServer:P

Pipes works in Editor, but not in Build

I'm using NamedPipes to tell Streamlabs OBS to change scene, thanks to this dll, i got it working in the Unity Editor, but it doesnt work when I make my build. Is there something that needs to be changed in my project settings?
(I have already set Api Compatibility Level to .NET 4.x, but that is the only thing i have changed)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.