mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Switch to another socket.io for c# lib #464
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yukozh on GitHub (Mar 15, 2020).
Originally assigned to: @GregorBiswanger on GitHub.
The SocketIoClientDotNet team will no longer maintain their project, and they've hidden their package, that blocks the nuget restore.
@GregorBiswanger commented on GitHub (Mar 15, 2020):
Yes, that's right and it's a problem. Unfortunately we have not yet found an alternative.
However Electron.NET currently works without problems with the last version of SocketIoClientDotNet.
Or did you have difficulties?
@query-wow commented on GitHub (Mar 18, 2020):
Good afternoon, i've been reading into this project, looks promising. Might be worth to check perhaps? https://github.com/LadislavBohm/socket.io-client-core
@GregorBiswanger commented on GitHub (Apr 17, 2020):
We would definitely have to try it out with a prototype.
It currently works with the last SocketIoClientDotNet version.
@GregorBiswanger commented on GitHub (May 10, 2020):
FYI @syedadeel2
@syedadeel2 commented on GitHub (May 11, 2020):
No more Sockets I'm near to the solution.
@dafergu2 commented on GitHub (May 18, 2020):
I'd be interested in helping with this. I've seen the bridge connector flake out on me after leaving my app running for a long time and it is the one thing that worries me the most.
What are you looking to swap this out with, @syedadeel2 ?
@dafergu2 commented on GitHub (May 18, 2020):
This is also an option to explore: https://github.com/HavenDV/H.Socket.IO/
@syedadeel2 commented on GitHub (May 20, 2020):
I'll reveal soon once I finish the solution. But no sockets for sure.
@sanosdole commented on GitHub (May 25, 2020):
There is an existing solution for C#/JS interop without websockets: https://github.com/sanosdole/nodeclrhost
If there is any interest in using it, i could provide assistance.
@GregorBiswanger commented on GitHub (May 25, 2020):
@syedadeel2 can you check this please?
@sanosdole commented on GitHub (May 25, 2020):
Easiest way to review the capabilities:
~/examples/electron-blazorand runnpm run~/examples/electron-blazor/LocalService) & renderer process (~/examples/electron-blazor/BlazorApp)Here is an old image from the example code that shows the first debugging of a Blazor App in Electron:

@GregorBiswanger commented on GitHub (May 25, 2020):
@sanosdole Thanks! electron-blazor uses Electron.NET :)
But we will definitely look at this...
Possibly, can you even build a small prototype?!
Here is a YouTube video that explains something about Electron.NET under the hood:
https://www.youtube.com/watch?v=Po-saU_Z6Ws
@sanosdole commented on GitHub (May 25, 2020):
@GregorBiswanger Thanks! electron-blazor uses Electron.NET :)
The prototype steve sanderson did. This one is an example from the nodeclrhost repository. It does not use Electron.NET and also no WASM. It invokes the Electron APIs directly in process using the C#/JS Interop.
Does this qualify as a small prototype? If not I have a large prototype but that is owned by my clients and i may not share this in the public.
I know the inner working of Electron.NET quite well, as we (me and a client of mine) researched it for replacing the GUI layer of a large XAML based application. So i read most of the code of this projects around a year ago.
As we required direct renderer memory access for some special 3D controls, I started this project to host a dotnet core CLR through a native node addon.
Edit: I`ll watch the video later this evening when I have time. At first I thought you meant the introductionary Video on how to use electron.
@GregorBiswanger commented on GitHub (May 25, 2020):
@sanosdole everything sounds very exciting.. I will take a closer look at this tonight and how we could take it with us..
how does the communication of classic ASP.NET Core MVC / Razor Pages work out here? They always need a web host to get their HTML pages?!
@sanosdole commented on GitHub (May 25, 2020):
I researched this when i started. It is theoretically possible to skip opening a port using an electron resource handler implementation. But to get this working an alternative WebHost implementation is required and that would require some heavy (reverse-)engineering work. Especially making websockets (e.g. Server-Side Blazor) work would be quite an investment.
I never did an example for a MVC app, but i think it would be straight forward when using kestrel.
@syedadeel2 commented on GitHub (May 29, 2020):
This is was my original plan using JSInterop but I'm looking in different solution as I find the performance is not as what I'm expecting when doing a lot of calls. Other thing is that this good when you are app is running the in electron but what we are trying here to controls the electron on startup and hook events at this stage your app isn't loaded in the browser. to resolve this I'm actually testing some different solution and use cases. But good work has been done for "nodeclrhost" and have lot of potentials. Maybe I will combine this in my solution
And I'm trying not to build this especially for Blazor - my scope is to build one for all of-course the SPA/PWA gives the best experiences.
I'll let you know once I'm near to this :)
@sanosdole commented on GitHub (May 29, 2020):
Well this is not true. The dotnet CLR is hosted by the node process using a native plugin. Everything is in one process and calls are native. We are directly hooking up dotnet code and JS code.
The benchmarks in the
coreclr-hostingpackage shows that invoking JS is of course slower than JS itself. (Mostly due to optimizations in the v8)We are talking about 15000000 ops/sec on my machine. That is about 0.66 micro-seconds overhead per JS invocation.
The only possible architectural optimization I´m seeing is skipping the nodeJS native ABI and directly integrating with the used v8 engine. And this would be tremendous work for not much of an improvement.
Am I missing an alternative way to integrate dotnet with JS?
nodeclrhostis a generic node/dotnet interop mechanism first (coreclr-hosting&NodeHostEnvironmentprojects). It is not bound to Electron or ASP.NET. The Blazor in renderer Process parts are separate projects (electron-blazor-glue&ElectronHostedBlazorprojects) that could be moved to another repository.Also please take a look at the mvc-example branch. It contains a fully working MVC/RazorPages Electron application in
~/examples/electron-mvc. The only thing modified from the defaultwebapptemplate is theProgram.cs.@freosc commented on GitHub (Jul 1, 2020):
@syedadeel2 Did you reach any progress on this one? I'm anxious to know cause I need to decide whether to use ElectronJs with or without Electron.net.
@GregorBiswanger commented on GitHub (Jul 1, 2020):
@freosc You can use Electron.NET without problems. We would change the communication, but without breaking changes here.
@freosc commented on GitHub (Jul 1, 2020):
Many thanks for the work you've done to this project already. But can you give me an expected ETA of the new IPC backend? I'll be one of the pioneers to test it ;)
@GregorBiswanger commented on GitHub (Jul 1, 2020):
@freosc Do you have currently problems with the current one?
I have no time plan, I think the next weeks we have more Infos for you.
@freosc commented on GitHub (Jul 1, 2020):
The problem I have is the disconnecting issue (Got disconnect! Reason ping timeout). Even with 9.31.1 and the latest SocketIO client.
If I leave the app running for a few hours on a test PC without doing anything (actually 2 hours seems to be enough), a disconnect occurs (ping timeout), after that, all communication is broken between browser and .net core mvc app.
@syedadeel2 commented on GitHub (Jul 4, 2020):
I'll update you guys soon, Sorry just got caught with COVID-19 stuff within my organization and I'm hardly getting time for me. But let me give you guys some insight I'm working with Edge.js to use In-process method to avoid the Sockets. I'll soon complete the small prototype and share with @GregorBiswanger. Once we agreed we will start working on the full project not sure maybe a separate repo.
@sanosdole commented on GitHub (Jul 4, 2020):
@syedadeel2 If you are using EdgeJS please consider switching over to nodeclrhost.
We have written
nodeclrhostbecauseedge.jsis a dead project. It has not been updated for some years now (last commit on official repo is more than 3 years ago) and has no official support for the core clr. There are some forks that might work, butnodeclrhosthas a lot more features like a less restrictive interop API based on the dynamic language runtime with support for synchronous JS invocation and invoking any JS code directly from C#.I also have already done a prototype that is running
Electron.NETthroughnodeclrhostover here. It basically works besides having Exceptions on shutdown and not being tested thoroughly.I only spend a few hours to write the
Electron.NETprototype, so it proves viability. The downsides of in-process communication are the same as foredge.js, it only uses a different interop API. I believe it would be advantageous to merge efforts here, as it is the same thing without a dead project in the middle.If you are interested in using
nodeclrhostinstead ofedgejs, i could give you some help. I want people to work withnodeclrhostso I can improve its API, documentation and stability.@syedadeel2 commented on GitHub (Jul 5, 2020):
@sanosdole I can see what you are saying :) I have forked your nodeclrhost let me try that as well.
@syedadeel2 commented on GitHub (Jul 10, 2020):
@sanosdole @GregorBiswanger I have sent you guys an invite to join my private repo where I'm pushing the code for the new version. It's not ready yet just a skeleton but just added you guys so we can create the project and think about what to add and what not.
@rakista112 commented on GitHub (Jul 30, 2020):
@syedadeel2 I could help with mac efforts in the new IPC backend if you invite me to the repo.
Our project is invested in Electron.NET and we are facing the disconnect/no-reconnect issue in Mac.
@freosc commented on GitHub (Aug 12, 2020):
@syedadeel2 Did you reach any progress? What's the plan? If extra help is needed, I'm also willing to do something.
@GregorBiswanger commented on GitHub (Aug 12, 2020):
@freosc The last few weeks I've been busy with my business. I think I will have time for that in the next few weeks.
@syedadeel2 commented on GitHub (Aug 13, 2020):
that's why I was wondering where you gone :)
@syedadeel2 commented on GitHub (Sep 19, 2020):
@sanosdole I'm working on the new repo, and I'm still waiting for you to accept my invite also there is some issue with your nodeclr if you have time we can talk about.
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
@Yuvix25 commented on GitHub (Jan 31, 2024):
Any update on this? Help needed?