System.Net.SocketPermissionAttribute Class

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

See Also: SocketPermissionAttribute Members


[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


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.


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.


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.


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