System.Net.SocketPermissionAttribute Class

Specifies security actions to control System.Net.Sockets.Socket connections. This class cannot be inherited.

See Also: SocketPermissionAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
public sealed class SocketPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute

Remarks

To use this attribute, your System.Net.Sockets.Socket connection must conform to the properties that are specified in your System.Net.SocketPermissionAttribute. For example, to apply the permission to a System.Net.Sockets.Socket connection on port 80, set the SocketPermissionAttribute.Port property of the System.Net.SocketPermissionAttribute to "80". The security information that is specified in System.Net.SocketPermissionAttribute is stored in the metadata of the attribute target, which is the class to which the System.Net.SocketPermissionAttribute is applied. The system then accesses the information at run time. The System.Security.Permissions.SecurityAction that is passed to the constructor determines the allowable System.Net.SocketPermissionAttribute targets.

Note:

The properties of a System.Net.SocketPermissionAttribute must have values that are not null. Also, once set, the values of the properties cannot be changed.

Note:

For more information about using attributes, see [<topic://cpconExtendingMetadataUsingAttributes>].

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.x.x, 1.0.5000.0, 2.0.0.0, 4.0.0.0