Peer Distribution API Functions
The Microsoft Peer Distribution service supports functions for both consumer role and publisher role scenarios.
The following functions are common in both "client" and "server" scenarios.
Common Functions | Description |
---|---|
PeerDistStartup | Creates a new PEERDIST_INSTANCE_HANDLE instance which must be passed to all other Peer Distribution APIs. |
PeerDistShutdown | Releases resources allocated by the call to PeerDistStartup. |
PeerDistGetStatus | Returns the current status of Peer Distribution service. |
PeerDistGetStatusEx | Returns the current status and capabilities of the Peer Distribution service. |
PeerDistGetOverlappedResult | Retrieves the results of asynchronous operations. |
PeerDistRegisterForStatusChangeNotification | Requests that the Peer Distribution service notify the caller when a status change occurs. |
PeerDistRegisterForStatusChangeNotificationEx | Requests that the Peer Distribution service notify the caller when a status change occurs. |
PeerDistUnregisterForStatusChangeNotification | Deregisters the status change notification for the session associated with the supplied handle. |
The following functions are only supported in "client" scenarios.
Client Functions | Description |
---|---|
PeerDistClientOpenContent | Opens and returns a PEERDIST_CONTENT_HANDLE to reference that content. |
PeerDistClientCloseContent | Closes the PEERDIST_CONTENT_HANDLE. |
PeerDistClientGetInformationByHandle | Retrieves additional information from the Peer Distribution service for a specific content handle. |
PeerDistClientAddContentInformation | Adds content information which is then associated with the PEERDIST_CONTENT_HANDLE. A PEERDIST_CONTENT_HANDLE can be associated with any content information. |
PeerDistClientCompleteContentInformation | Indicates the end of the content information. |
PeerDistClientAddData | Used to supply content to the local cache. Typically this is done when data could not be found on the local network as indicated when either PeerDistClientBlockRead or PeerDistClientStreamRead complete with ERROR_TIMEOUT or PEERDIST_ERROR_MISSING_DATA.. |
PeerDistClientBlockRead | Provides random access to the content stream. |
PeerDistClientStreamRead | Provides sequential access to the content stream. |
PeerDistClientFlushContent | Removes content that has been previously added to the local Peer Distribution system. |
PeerDistClientCancelAsyncOperation | Cancels asynchronous operation associated with an OVERLAPPED structure and the content handle returned by PeerDistClientOpenContent. |
The following functions are only supported in "server" scenarios.
Server Functions | Description |
---|---|
PeerDistServerPublishStream | Creates the PEERDIST_STREAM_HANDLE which can be used with PeerDistServerPublishAddToStream to create content information for the content stream. |
PeerDistServerPublishAddToStream | Adds data to the stream referenced by the PeerDist stream handle. |
PeerDistServerPublishCompleteStream | Called to indicate that all data has been added to the stream. |
PeerDistServerCloseStreamHandle | Closes the stream handle. |
PeerDistServerUnpublish | Unpublishes previously published content in the Peer Distribution service. |
PeerDistServerOpenContentInformation | Opens a PEERDIST_CONTENTINFO_HANDLE for published content. |
PeerDistServerOpenContentInformationEx | Opens a PEERDIST_CONTENTINFO_HANDLE for published content. |
PeerDistServerRetrieveContentInformation | Retrieves the content information associated with published content. |
PeerDistServerCloseContentInformation | PEERDIST_CONTENTINFO_HANDLE opened by PeerDistServerOpenContentInformation. |
PeerDistServerCancelAsyncOperation | Cancels the asynchronous operation associated with the content identifier and OVERLAPPED structure. |