mscorlib(4.0.0.0) API with additions
|
Controls rights to make or accept connections on a transport address. More...
Public Member Functions | |
SocketPermission (PermissionState state) | |
Initializes a new instance of the T:System.Net.SocketPermission class that allows unrestricted access to the T:System.Net.Sockets.Socket or disallows access to the T:System.Net.Sockets.Socket. More... | |
SocketPermission (NetworkAccess access, TransportType transport, string hostName, int portNumber) | |
Initializes a new instance of the T:System.Net.SocketPermission class for the given transport address with the specified permission. More... | |
void | AddPermission (NetworkAccess access, TransportType transport, string hostName, int portNumber) |
Adds a permission to the set of permissions for a transport address. More... | |
bool | IsUnrestricted () |
Checks the overall permission state of the object. More... | |
override IPermission | Copy () |
Creates a copy of a T:System.Net.SocketPermission instance. More... | |
override IPermission | Union (IPermission target) |
Returns the logical union between two T:System.Net.SocketPermission instances. More... | |
override IPermission | Intersect (IPermission target) |
Returns the logical intersection between two T:System.Net.SocketPermission instances. More... | |
override bool | IsSubsetOf (IPermission target) |
Determines if the current permission is a subset of the specified permission. More... | |
override void | FromXml (SecurityElement securityElement) |
Reconstructs a T:System.Net.SocketPermission instance for an XML encoding. More... | |
override SecurityElement | ToXml () |
Creates an XML encoding of a T:System.Net.SocketPermission instance and its current state. More... | |
![]() | |
void | Demand () |
Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance. More... | |
void | Assert () |
Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. Using M:System.Security.CodeAccessPermission.Assert can create security issues. More... | |
void | Deny () |
Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance. More... | |
void | PermitOnly () |
Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance. More... | |
override string | ToString () |
Creates and returns a string representation of the current permission object. More... | |
override bool | Equals (object obj) |
Determines whether the specified T:System.Security.CodeAccessPermission object is equal to the current T:System.Security.CodeAccessPermission. More... | |
override int | GetHashCode () |
Gets a hash code for the T:System.Security.CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table. More... | |
Public Attributes | |
const int | AllPorts = -1 |
Defines a constant that represents all ports. More... | |
IEnumerator | ConnectList => m_connectList.GetEnumerator() |
Gets a list of T:System.Net.EndpointPermission instances that identifies the endpoints that can be connected to under this permission instance. More... | |
IEnumerator | AcceptList => m_acceptList.GetEnumerator() |
Gets a list of T:System.Net.EndpointPermission instances that identifies the endpoints that can be accepted under this permission instance. More... | |
Additional Inherited Members | |
![]() | |
static void | RevertAssert () |
Causes any previous M:System.Security.CodeAccessPermission.Assert for the current frame to be removed and no longer in effect. More... | |
static void | RevertDeny () |
Causes any previous M:System.Security.CodeAccessPermission.Deny for the current frame to be removed and no longer in effect. More... | |
static void | RevertPermitOnly () |
Causes any previous M:System.Security.CodeAccessPermission.PermitOnly for the current frame to be removed and no longer in effect. More... | |
static void | RevertAll () |
Causes all previous overrides for the current frame to be removed and no longer in effect. More... | |
Controls rights to make or accept connections on a transport address.
Definition at line 11 of file SocketPermission.cs.
System.Net.SocketPermission.SocketPermission | ( | PermissionState | state | ) |
Initializes a new instance of the T:System.Net.SocketPermission class that allows unrestricted access to the T:System.Net.Sockets.Socket or disallows access to the T:System.Net.Sockets.Socket.
state | One of the T:System.Security.Permissions.PermissionState values. |
Definition at line 34 of file SocketPermission.cs.
System.Net.SocketPermission.SocketPermission | ( | NetworkAccess | access, |
TransportType | transport, | ||
string | hostName, | ||
int | portNumber | ||
) |
Initializes a new instance of the T:System.Net.SocketPermission class for the given transport address with the specified permission.
access | One of the T:System.Net.NetworkAccess values. |
transport | One of the T:System.Net.TransportType values. |
hostName | The host name for the transport address. |
portNumber | The port number for the transport address. |
T:System.ArgumentNullException | hostName is null . |
Definition at line 53 of file SocketPermission.cs.
void System.Net.SocketPermission.AddPermission | ( | NetworkAccess | access, |
TransportType | transport, | ||
string | hostName, | ||
int | portNumber | ||
) |
Adds a permission to the set of permissions for a transport address.
access | One of the T:System.Net.NetworkAccess values. |
transport | One of the T:System.Net.TransportType values. |
hostName | The host name for the transport address. |
portNumber | The port number for the transport address. |
T:System.ArgumentNullException | hostName is null . |
Definition at line 67 of file SocketPermission.cs.
|
virtual |
Creates a copy of a T:System.Net.SocketPermission instance.
Implements System.Security.CodeAccessPermission.
Definition at line 102 of file SocketPermission.cs.
|
virtual |
Reconstructs a T:System.Net.SocketPermission instance for an XML encoding.
securityElement | The XML encoding used to reconstruct the T:System.Net.SocketPermission instance. |
T:System.ArgumentNullException | The securityElement is null . |
T:System.ArgumentException | The securityElement is not a permission element for this type. |
Implements System.Security.CodeAccessPermission.
Definition at line 281 of file SocketPermission.cs.
|
virtual |
Returns the logical intersection between two T:System.Net.SocketPermission instances.
target | The T:System.Net.SocketPermission instance to intersect with the current instance. |
null
. If the target parameter is a null reference, the method returns null
.T:System.ArgumentException | The target parameter is not a T:System.Net.SocketPermission. |
T:System.Security.SecurityException | T:System.Net.DnsPermission is not granted to the method caller. |
Implements System.Security.CodeAccessPermission.
Definition at line 169 of file SocketPermission.cs.
|
virtual |
Determines if the current permission is a subset of the specified permission.
target | A T:System.Net.SocketPermission that is to be tested for the subset relationship. |
null
, this method returns true
if the current instance defines no permissions; otherwise, false
. If target is not null
, this method returns true
if the current instance defines a subset of target permissions; otherwise, false
.T:System.ArgumentException | target is not a T:System.Net.Sockets.SocketException. |
T:System.Security.SecurityException | T:System.Net.DnsPermission is not granted to the method caller. |
Implements System.Security.CodeAccessPermission.
Definition at line 209 of file SocketPermission.cs.
bool System.Net.SocketPermission.IsUnrestricted | ( | ) |
Checks the overall permission state of the object.
true
if the T:System.Net.SocketPermission instance is created with the Unrestricted
value from T:System.Security.Permissions.PermissionState; otherwise, false
.Implements System.Security.Permissions.IUnrestrictedPermission.
Definition at line 95 of file SocketPermission.cs.
|
virtual |
Creates an XML encoding of a T:System.Net.SocketPermission instance and its current state.
Implements System.Security.CodeAccessPermission.
Definition at line 411 of file SocketPermission.cs.
|
virtual |
Returns the logical union between two T:System.Net.SocketPermission instances.
target | The T:System.Net.SocketPermission instance to combine with the current instance. |
null
, it returns a copy of the current instance.T:System.ArgumentException | target is not a T:System.Net.SocketPermission. |
Reimplemented from System.Security.CodeAccessPermission.
Definition at line 136 of file SocketPermission.cs.
IEnumerator System.Net.SocketPermission.AcceptList => m_acceptList.GetEnumerator() |
Gets a list of T:System.Net.EndpointPermission instances that identifies the endpoints that can be accepted under this permission instance.
Definition at line 30 of file SocketPermission.cs.
const int System.Net.SocketPermission.AllPorts = -1 |
Defines a constant that represents all ports.
Definition at line 20 of file SocketPermission.cs.
IEnumerator System.Net.SocketPermission.ConnectList => m_connectList.GetEnumerator() |
Gets a list of T:System.Net.EndpointPermission instances that identifies the endpoints that can be connected to under this permission instance.
Definition at line 26 of file SocketPermission.cs.