CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    31

    Question Communication between Windows C# app and Linux web server?

    Let me preface this by saying I have never done any network/web programming. I don't even know if this is in the right subform. Here is my situation:

    I have a C# Windows Forms application (created in Express 2010 .NET 4.0) running on my personal computer at home. I need to send the STATUS (a few bytes at most) of the home PC application to a server application (???) that will be hosted on my website which runs on a Linux server on Eleven2.com. I would like to access this information on the server app from an Android phone. In addition to requesting the STATUS, I would like to send COMMANDS back to the C# Windows application using a few simple buttons.

    In Summary:

    1. Phone asks for STATUS from web server (through web app or other means...native app)
    2. Web server then asks C# Windows app (which is running on my home PC) for STATUS
    3. C# Windows app responds to server and provides STATUS to web server
    4. Web server updates STATUS and is then available to the phone

    This is part of a much bigger personal project. I don't need an overly complicated or robust solution. I just need to send a small amount of data back and forth over an open channel. It does not need to be secure.

    Websocket, TCP sockets, PHP, Java.... I honestly really don't know where to start. I started looking into WebSocket4Net, but didn't want to end up at a dead end. So I came here for advice.

    What do I need on the client side?
    What do I need on the server side?

    Any help or guidance you can provide is greatly appreciated. Thanks!

  2. #2
    Join Date
    Mar 2001
    Posts
    2,529

    Re: Communication between Windows C# app and Linux web server?

    I would suggest TCP/IP Sockets in C for the Server, C# for the Client App and maybe Java for the phone?

    Ok well you will have to look up the phone specs and developer doco to see what is supported, but many smart phones are Droids, that support a flavor of Java.

    Here is a link that contains some pretty good books. The companion source code is good too, and it is out there
    on the internet.

    http://cs.baylor.edu/~donahoo/

    I completed a very similar project once, found encryption to be a pretty important aspect.

    HTH and good luck!
    ahoodin
    To keep the plot moving, that's why.

  3. #3
    Join Date
    Feb 2006
    Posts
    31

    Re: Communication between Windows C# app and Linux web server?

    Quote Originally Posted by ahoodin View Post
    I would suggest TCP/IP Sockets in C for the Server, C# for the Client App and maybe Java for the phone?
    ...
    HTH and good luck!

    Thanks for the response. I will definitely look into this. I also had a friend recommend setting up an IIS server on the same machine as my client app (bypassing the need for a hosted website) and using websockets so that I can use a browser. He also pointed me to this nifty page telling me what browsers are compatible (http://caniuse.com/websockets).

    I will look into both solutions. Thanks again for replying. If you (or anyone else) has any more feedback, I would gladly appreciate it. I will try my best to update this with whatever solution I choose.

  4. #4
    Join Date
    Mar 2001
    Posts
    2,529

    Re: Communication between Windows C# app and Linux web server?

    Well if you use an IIS browser on the same machine, you can definitely get a jump on development. If you plan is to use a Linux based web server, you are better off using the web server you plan on implementing your website to check for browser and protocol compatibilities. Additionally, you will learn more about your solution if you have to think about the firewall, encryption and networking from the start. Additionally you will learn the tricks associated with whatever platform you intend to roll out on which will come in handy.
    Last edited by ahoodin; October 23rd, 2012 at 12:55 PM. Reason: fix grammer
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured