c# client (windows) - server (linux debian) solution - c#

I need help with small app I am working on.
Its small client collecting some data from user and I need to sent them to server and receive data from server... Last time I made it: client in c# was getting data from server through webserver PHP...(sending POST request via c# and parsing output page) It will be beter to have TCP/IP connection...
Whats the best and easy solution to do that? I have skills in php, c# (not c++)
Does MONO support all c# socked functions? Is it possible to run MONO on linux debian server without graphical interface.. (bash only)?
I need to: send/receive data and authenticate user...
thx for help

Related

How to deploy a C# language server, and use WebSockets for communication with client?

I am trying to host a web page with monaco editor and add intellisense for c#. From what I have found I should use monaco-languageclient with a language server running in a different process and have both communicate over some transport channel, like a web socket.
I have tried many things with no success, but my problem is that I do not know how to start with the Language Server part. I cannot find any specific tutorial on running a C# language server.
If it is possible for anyone to provide a good source for me to get started.
I'd recommend using omnisharp-roslyn, which has --languageserver flag to work on the ls protocol.

Making two programs talk with each other

My group in the university are working on a project, which includes us making a C# program. We have a vision of making a server side console program that is constantly calculating data and then make a client side program that can fetch the data from our server side program. The client side program will then be able to display the data and the user is able to navigate forth and back around the data. Both of these programs will be run on the same computer solely for exercise purpose.
I am wondering how I can get data from the server side program and be able to display it on the client side program.
If both client and server are always on the same machine, there is no need at all to use WCF or Sockets. You can use named pipes for the interprocess communication.
If you're trying to do a more serious client/server application, I recommend you to try Redis which provides a lot of remote features like pub/sub and caching, so you'll avoid reinventing the wheel.
As mentioned in the comments that sounds like you would like to create a "server" like application which you could do with WCF.
http://tech.pro/tutorial/855/wcf-tutorial-basic-interprocess-communication
There are also some workarounds if you wish to do so, using a Database or use a folder containing Text Files,that would include a folder watcher, which you than read, but they are not that elegant.
You can get data to the client program by configuring it by using web.api self hosting. Here is a great link. The server app can be configured to use the same thing. They can both listen and answer one another.
http://www.c-sharpcorner.com/UploadFile/b1df45/Asp-Net-web-api-self-hosting/
Why don't you give ASP.NET Web API a chance?
You'll be creating a REST API that not only a C# program can talk to (any language/implementation - even another server) can talk to your server as long as the end point is correct (in your case would be your IP address and port number) & of course, you don't need both programs to be on the same computer as well :)

Send Data From PHP to C# or VB.NET

Today'm trying to pass a variable and an array of PHP to a desktop application, but I have no clue how to do it.
To be more precise in my question I need PHP run the Desktop Application Developed in C # or VB.NET and send a variable.
If anyone can help me with some solution,suggestion or method is welcome Thank You.
You should send the information to the client in a format you can parse client side. XML would be one example.
So if you go the XML route (I'd look for a better transport data structure)
PHP outputs XML when the client application requests the data
The client then parses the XML pulling the data from it and storing it as a native data structure
Given your clarification in your comment (that you want to do this on the client machine), the answer is you can't. PHP doesn't run on the clients machine, it runs on your server and outputs to the clients browser, the browser then interprets that and displays the results, the browser doesn't run other applications as that is asecurity breach...except when downloading certain mime-types. If you are doing this with the users knowing cooperation, that might be a solution. If you control both code bases (the PHP and C#), then it's more likely, it would make more sense for the user to run the desktop app and for it to communicate with the PHP page to get the info it has.

Android connecting to a .NET application and sending text

I have a C# .NET application listening on a specific port for data (SocketServer).
Using Android, I would like to connect to that SocketServer and send text data to it. I do not know where to get started - sample code would be great.
Take a look at TCP .NET/C# Server with Java client?.
Other than that, you could always recode your server into a REST service, and then anything can communicate with it. But I know this isn't a good answer as I'm sure you don't want to recode the server.

Instant Server-Client Communication, C#?

I have been doing research for a few months now on the possibility of client-server communication. I have experimented with many methods such as WebORB and FluorineFX, which are both servers designed to deal with client/server authentication.
WebORB only runs on Windows for their .NET version as far as I can tell, and I would much rather use an open source system. I have tried using FluorineFX, but I think their must be a simpler way for me to build my own simple system from the ground up.
I have been using Dropbox for a while now, and I like the way that the client-server communication is instant. As far as I can tell (from some Google searches) the client doesn't open a port of its own, and just communicates with the Dropbox server through port 80. An example of its instant communication is where you may delete a file on Dropbox on their website, and instantly the server communicates with the client telling it what has happened. I don't know how this instant communication is possible without opening a port.
I can create a system that uses fetching from the client, asking the server every 10 seconds or so to see if there are any updates, but I would like a method to be able to push the information from the server to the client.
My server runs Linux so I don't think I can use WCF, and ideally I am looking for a way to make PHP and C# communicate with each other.
I would love to hear any advice that anyone has and how they deal with the problem.
Cheers.
You CAN use WCF to communicate with any platform. Just make sure you're using an endpoint which your target machine support: http://msdn.microsoft.com/en-us/library/ms733107.aspx
Have you tried the good old .NET Remoting which runs perfectly with Mono?
You can choose between a TcpChannel (for performance) and a HttpChannel (to pass proxy/firewall easily).
For push notifications, you can open a connection to your server and wait for an answer indefinitely.

Categories