Search code examples
c#serverremote-server

Client on mobile which would control/send commands to my pc server client


I don't know where to start, so let's start by saying what I want.

An application on my Phone which would control/send commands to my PC

I am not asking how to code it, I want to get a brief idea on what I need in order to do it. I had thought of using ASP .NET Core Web Application, but I am not sure if that's what I need, I need a server to be running on the PC, so that the phone will connect to and send commands to the PC Client from the Mobile Client.

Also, It needs to be C# since its the only language I am fluent in.

Which library should I use on the PC and the Mobile?


Solution

  • You can use ASP.NET Core to create a web service that is hosted on your PC. The application on your phone could send commands by sending HTTP requests to the web service.

    For example, the web service could react to a request like:

    POST http://localhost:8080/do-stuff
    

    But the web service method is not the most performant one. If you put a priority on performance, you should rather work with sockets. You can use the .NET classes like in this example or use a library.

    If you want to develop everything with C#, I would recommend using Xamarin for developing the mobile app.