NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Web and Socket Permissions

Internet security for applications using System.Net is provided by the WebPermissions and SocketPermissions classes. The WebPermissions class controls an application's right to request data from a URI or to serve a URI to the Internet. The SocketPermissions class controls an application's right to accept data on a local port or to contact applications via a transport protocol at another address based on the host, port number, and transport protocol.

You should choose the permission class based on your application type. Applications that use WebRequest and its descendents should use the WebPermissions class to manage permissions. Applications using socket-level access should use the SocketPermissions class to manage permissions.

WebPermissions and SocketPermissions define two permissions, accept and connect. Accept grants the application the right to answer an incoming connection from another party. Connect grants the application the right to initiate a connection to another party.

For SocketPermissions, accept means that an application can accept incoming connections on a local transport address; connect means that an application can connect to some remote (or potentially local) transport address.

For WebPermissions, accept means that an application can export that URI to the world; connect means that an application can access that URI (be it remote or local).