1

For my college project i wish to make a website(PHP) that communicates(possibly in realtime) with a .Net desktop app(WPF) on the same server.Being a complete noob with php,i do not see any way to do this directly,any help in the right direction just to get me started?

EDIT: App is a WPF desktop app in C#

Atif
  • 129
  • 1
  • 14
  • Are we talking VB.net app, or a windows service written in .net or ASP.net. Basically what i am getting at is, .net is too vague to even begin to give you any kind of answer. – Geoffrey Wagner Jan 17 '11 at 22:02
  • @Geoffery Sorry, my bad!Im trying to make a WPF desktop app using C# and .NET 4.0. – Atif Jan 17 '11 at 23:23

2 Answers2

1

You might like to take a look at socket programming.

Let your C# app open a socket and listen to it.

Your PHP then connects to that socket, either requests information or sends information. And you are done. No need for polling.

Listen to the socket in an asynchronous way.

Daan Timmer
  • 14,771
  • 6
  • 34
  • 66
0

One way you could do this without getting too far down the rabbit hole is to have the two applications share a database, either MS SQL or MySQL, whatever flavor you prefer. Then as data is created and modified by the web application in PHP, your .NET WPF application can see the updated data and do whatever it is that you want it to do. You can even use simple timer objects in your .NET app to scan the DB for changes if you want the updates to show without user input.

Infotekka
  • 10,307
  • 2
  • 20
  • 17
  • hmm...i did think of that but i want the information changes to be communicated in realtime,im kind of working on an automation app that'll be turning devices on or off based on the user input from the website,i kind of thought of a mechanism where the php code writes a file each time theres new input and the desktop app keeps polling to check if such a file exists and then gobbles it up,but im running into problems if i keep polling too fast. – Atif Jan 17 '11 at 23:20