how to send event to chrome extension from C# native host - c#

I had created a chrome extension and a c# host application, the chrome app is sending events to the c# host application. But how we can receive the events in chrome from the host app.

I found a solution for this; a C# application can control the Chrome add-on using the native messaging and the pipe channel.
The pipe stream channel is connected between two C# apps and one end of the pipe is connected to the native messaging which is a channel for the browser and the C# app.
But my application is not completely ready. I'm working on it to get a reliable channel communication between these two channels.

Related

How to send request from rest API to Windows Application

as the question says, how can I communicate from a rest API to Windows application. I have Windows application that connects to a linux server over TCP connection. This application manages multiple connections (around 7-8k tcp connection on different ports and keeps alive these connections all the time.). I have a mobile application that connects to rest API (APS.net C#) and works as expected. Now i want to send some more information from linux server to mobile client. How can I send a request from rest API to windows application and get response to send it to mobile application when requested from mobile. This communication between API and Windows application should be asynchronous and could handle around 7-8k connections without delay. How can i achieve this? Is it possible to achieve this using current architecture? or should I change it? I am willing to adopt any proposed architecture or new framework and any other programming language which serves the purpose good. Here is rough structure.
I think you can try using SignalR, it allows for dual communication between client and serer
It uses websockets as its underlying connection and you can either send messages to all connected clients or a specific client.
https://dotnet.microsoft.com/apps/aspnet/signalr

Send message to citrix client driver

I download SDK from here SDK. The vdovern custom virtual channel Client/Server project is successfully run. Now i want to communication between c# application and vdovern.dll(citrix client driver).
[SendMessage] API use for a send message from c# app to citrix client driver. but sendmessage API need HWND.
How to get window handle(citrix client driver) to send message from c# application to vdovern.dll(citrix client driver)?
Is there any other way to send message to citrix client driver?
Thanks,
Citrix has provided virtual channel sdks, user can download the sdk from citrix website. It comes with some sample code and good documentation. SDKs has 2 components a server side executable and a client driver dll. when this exeutable is launched it loads client side driver in its context and creates a virtual cahnnel. User can pass data from server to client using these 2 components. Steps to build these components are given below:
http://ajdevtech.blogspot.com/2019/01/working-with-citrix-virtual-channel-sdk.html

Web Socket between C# Console Application and a browser

Is it possible (and simple) for C# console to open a web socket with a browser, without using Node.js? Meaning, an active and opened C# console application, always running on the server, which can send and receive messages to and from the browser at real time.
I tried to use a browser loading the socket.io.js JS file (https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js), and creating a C# console application using TcpListener class. And there seems to be a successful connection. But I can't send messages between the server and the client.
Yes, I've done it several times.
C# console / Windows service: Use SignalR library. Should be able to get it via NuGet.
Web application: Use jquery.signalr-x.x.x.js library.
SignalR should primarily establish a WebSocket connection between the SignalR hub in our .NET app, and the jquery.signalr client library in your web application.

Read Client side Serial Port in ASP.NET C#

i need help in reading clients Serial port (COM port) from my web application.
i am able to read it on windows application but if i wants to put it over the web.
is it possible to do so?
I could be wrong, but I don't think it's possible to read a serial port (or indeed any type of port) directly from the browser because there isn't going to be any interface to the underlying system hardware, etc.
However depending on what you need to do there are a couple of options (and probably more that I haven't thought of)
Browser plugin
You could write a browser plugin that can do whatever it wants (within the limitations of a browser plugin of course) and can be used by your webpage by injecting the serial data feed into the page.
The problem with this would maybe having to create plugins for all browsers (assuming you want the web application to run on whatever browser the user chose)
Self-hosted WebAPI in a desktop app
You could embed a self-hosted Web API into either your existing desktop app or a tray application / Windows service, etc, that interfaced with the serial port as you currently do.
This app or service would read the data and "publish" it via a simple JSON-based api that your web app can GET (or could use web sockets to push the data once the initial connection is made by the web app) and could also accept commands from the web browser via POST, etc.
Your web application could then access this via HTTP to get the data and do whatever it liked with it.
Either way, I think the user is going to have to install something to their local system for this to work.

Call Windows Service from Browser

I want to send data to a driver software via browser application with in same machine. If this driver can keep on listening to external connection via socket as a windows service, can I write a web application to send data to this driver by using php, applet or .net. Driver is written in C#. Is this possible and if so can someone show me a path/suggestions or any resource related to this?
I do not know a whole lot about drivers...
But, if you can self-host a WCF service in the C# driver, than you can do IPC (inter-process communication) on the same machine. The WCF could expose multiple endpoints ie.) http, namedpipe, or tcp and the .NET web application can subscribe to the service and send data to the C# driver.
Also, if you use a http or tcp endpoint, i believe that the web application would be able to connect to the C# driver from another machine.
WCF Reference: http://msdn.microsoft.com/en-us/library/ms731082.aspx
you could use web sockets WebSocket, however your driver would have to handle the handshake.

Categories

Resources