mscorlib(4.0.0.0) API with additions
System.Net.SocketPermission Class Reference

Controls rights to make or accept connections on a transport address. More...

Inheritance diagram for System.Net.SocketPermission:
[legend]
Collaboration diagram for System.Net.SocketPermission:
[legend]

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...
 
- Public Member Functions inherited from System.Security.CodeAccessPermission
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 Public Member Functions inherited from System.Security.CodeAccessPermission
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...
 

Detailed Description

Controls rights to make or accept connections on a transport address.

Definition at line 11 of file SocketPermission.cs.

Constructor & Destructor Documentation

◆ SocketPermission() [1/2]

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.

Parameters
stateOne of the T:System.Security.Permissions.PermissionState values.

Definition at line 34 of file SocketPermission.cs.

◆ SocketPermission() [2/2]

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.

Parameters
accessOne of the T:System.Net.NetworkAccess values.
transportOne of the T:System.Net.TransportType values.
hostNameThe host name for the transport address.
portNumberThe port number for the transport address.
Exceptions
T:System.ArgumentNullExceptionhostName is null.

Definition at line 53 of file SocketPermission.cs.

Member Function Documentation

◆ AddPermission()

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.

Parameters
accessOne of the T:System.Net.NetworkAccess values.
transportOne of the T:System.Net.TransportType values.
hostNameThe host name for the transport address.
portNumberThe port number for the transport address.
Exceptions
T:System.ArgumentNullExceptionhostName is null.

Definition at line 67 of file SocketPermission.cs.

◆ Copy()

override IPermission System.Net.SocketPermission.Copy ( )
virtual

Creates a copy of a T:System.Net.SocketPermission instance.

Returns
A new instance of the T:System.Net.SocketPermission class that is a copy of the current instance.

Implements System.Security.CodeAccessPermission.

Definition at line 102 of file SocketPermission.cs.

◆ FromXml()

override void System.Net.SocketPermission.FromXml ( SecurityElement  securityElement)
virtual

Reconstructs a T:System.Net.SocketPermission instance for an XML encoding.

Parameters
securityElementThe XML encoding used to reconstruct the T:System.Net.SocketPermission instance.
Exceptions
T:System.ArgumentNullExceptionThe securityElement is null.
T:System.ArgumentExceptionThe securityElement is not a permission element for this type.

Implements System.Security.CodeAccessPermission.

Definition at line 281 of file SocketPermission.cs.

◆ Intersect()

override IPermission System.Net.SocketPermission.Intersect ( IPermission  target)
virtual

Returns the logical intersection between two T:System.Net.SocketPermission instances.

Parameters
targetThe T:System.Net.SocketPermission instance to intersect with the current instance.
Returns
The T:System.Net.SocketPermission instance that represents the intersection of two T:System.Net.SocketPermission instances. If the intersection is empty, the method returns null. If the target parameter is a null reference, the method returns null.
Exceptions
T:System.ArgumentExceptionThe target parameter is not a T:System.Net.SocketPermission.
T:System.Security.SecurityExceptionT:System.Net.DnsPermission is not granted to the method caller.

Implements System.Security.CodeAccessPermission.

Definition at line 169 of file SocketPermission.cs.

◆ IsSubsetOf()

override bool System.Net.SocketPermission.IsSubsetOf ( IPermission  target)
virtual

Determines if the current permission is a subset of the specified permission.

Parameters
targetA T:System.Net.SocketPermission that is to be tested for the subset relationship.
Returns
If target is 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.
Exceptions
T:System.ArgumentExceptiontarget is not a T:System.Net.Sockets.SocketException.
T:System.Security.SecurityExceptionT:System.Net.DnsPermission is not granted to the method caller.

Implements System.Security.CodeAccessPermission.

Definition at line 209 of file SocketPermission.cs.

◆ IsUnrestricted()

bool System.Net.SocketPermission.IsUnrestricted ( )

Checks the overall permission state of the object.

Returns
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.

◆ ToXml()

override SecurityElement System.Net.SocketPermission.ToXml ( )
virtual

Creates an XML encoding of a T:System.Net.SocketPermission instance and its current state.

Returns
A T:System.Security.SecurityElement instance that contains an XML-encoded representation of the T:System.Net.SocketPermission instance, including state information.

Implements System.Security.CodeAccessPermission.

Definition at line 411 of file SocketPermission.cs.

◆ Union()

override IPermission System.Net.SocketPermission.Union ( IPermission  target)
virtual

Returns the logical union between two T:System.Net.SocketPermission instances.

Parameters
targetThe T:System.Net.SocketPermission instance to combine with the current instance.
Returns
The T:System.Net.SocketPermission instance that represents the union of two T:System.Net.SocketPermission instances. If target parameter is null, it returns a copy of the current instance.
Exceptions
T:System.ArgumentExceptiontarget is not a T:System.Net.SocketPermission.

Reimplemented from System.Security.CodeAccessPermission.

Definition at line 136 of file SocketPermission.cs.

Member Data Documentation

◆ AcceptList

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.

Returns
An instance that implements the T:System.Collections.IEnumerator interface that contains T:System.Net.EndpointPermission instances.

Definition at line 30 of file SocketPermission.cs.

◆ AllPorts

const int System.Net.SocketPermission.AllPorts = -1

Defines a constant that represents all ports.

Definition at line 20 of file SocketPermission.cs.

◆ ConnectList

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.

Returns
An instance that implements the T:System.Collections.IEnumerator interface that contains T:System.Net.EndpointPermission instances.

Definition at line 26 of file SocketPermission.cs.


The documentation for this class was generated from the following file: