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 d开发者_开发知识库o 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#
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.
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.
精彩评论