2013-01-19 24 views
-1

我有一個Windows 8的應用程序的想法,我必須使用服務器(我自己的),並在日常基礎上向所有客戶端發送幾個圖像。也可以將圖像從應用程序上傳到我的服務器。Windows(電話)8 - 圖像服務器+應用程序:REST或websockets

我在Windows 8和Windows Phone(7)上的應用程序開發經驗,只有C#/ XAML。但沒有遠程服務等。我的問題是我是否應該使用經典的REST API或更新的WebSockets。我相信最後一個有更多的表現。 爲了記錄,我不打算建立一個webclient。也許,如果應用成功,我會將其移植到Android應用。我認爲無論我選擇什麼,連接到.NET服務都可以。還有其他重要的因素可以指導我的決定嗎?

那你應該使用哪一個? 如果你有一個鏈接到.NET關於REST或WebSockets的一些好的教程(優先。與圖像,而不是僅僅的Hello World),請分享:)

感謝很多已經

回答

-1

答案其實很簡單:

When you need a service that provides data use REST, when you need to send some kind of messages or notifications use websockets. Websockets provide a full-duplex communication (bidirectional) while the client uses the web api (so it is unidirectional). 

    For example: you have a chat app. Use the service to get the users from the db and use websockets to send messages to users. 

檢查此鏈接,網頁API http://channel9.msdn.com/Events/Build/2013/3-504 和WebSockets的:您的信息:) http://msdn.microsoft.com/en-us/hh969243.aspx

+0

好感謝 –

相關問題