The network APIs have tremendous depth and enable your app to work in many ways. But it can be hard to figure out how and when to use the different APIs. To help you out, the Windows Networking Team has created poster-sized cheat sheets with overviews and code samples of the most popular network APIs. And, we’re working on more!
The cheat sheets tell you about the different APIs. But which API is the right one to use, and when? Here's an easy way to figure it out:
- Are you connecting to an HTTP server?
- For small, interactive transfers and to connect to web services for a mash-up type app, use the Windows.Web.Http HttpClient family of APIs.
- For larger transfers, or transfers that work even when your app is suspended, use the Windows.Networking.BackgroundTransfer classes. It can also do FTP transfers.
- To pre-load data for your app, you can use Windows.Networking.BackgroundTransfer.ContentPrefetcher (which also works with the HttpClient classes)
- Are you connected to a classic TCP or UDP server? Or to Bluetooth? Use the Windows.Networking.StreamSocket (TCP and Bluetooth) or DatagramSocket (UDP and Multicast) classes.
- Are you connecting to one of the new "WebSocket" servers? They aren't classic sockets (and don't interoperate with classic sockets), but they can tunnel through corporate proxies and interoperate with up-to-date HTML5 browsers. Websockets are in the Windows.Networking.Sockets namespace.
- Are you connecting to people in the same room? (For example, with Near Field Communication (NFC) tap to connect)? If so, use the Windows.Networking.Proximity PeerFinder and related classes; this can give you back a StreamSocket that you can use to communicate with peers.
Our first pack of cheat sheets are for the HttpClient, Sockets, and Background Transfer APIs. Download the pack now from the Microsoft Download Center. And let us know what other cheat sheets you need! [GD: Post Leach Level: 99%]
Microsoft Downloads - HttpClient. Background Transfer, and Sockets Network API Poster for Windows Runtime Developers
Windows runtime developers! This Network API poster describes some of the most popular Network APIs in the Windows Runtime classes. The set of posters includes HttpClient, Background Transfer, and Sockets
Date Published: 11/13/2013
WinRT81-HttpClient-BT-Socket-Poster.pdf, 502 KB
The poster is provided in PDF format. When you print it from the PDF, specify the dimensions as landscape Tabloid size (11 inches by 17 inches).
Worse case, this will make for nice Cube Poster-ware... Best case it will help you build even more awesome .Net'enabled Windows Runtime app's... :)