O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

SocketPermission

Synopsis

This permission controls whether code can make or accept socket connections for a given NetworkAccess, TransportType, hostname, and port number (see the four-argument form of the constructor). The static field AllPorts is a constant that represents permission to all ports, and can be used as the port argument to the constructor.

public sealed class SocketPermission : System.Security.CodeAccessPermission, 
                                                   System.Security.Permissions.IUnrestrictedPermission {
// Public Constructors
   public method SocketPermission(NetworkAccess access, 
        TransportType transport, string hostName, 
        int portNumber);  
   public method SocketPermission(
        System.Security.Permissions.PermissionState state);  
// Public Static Fields
   public const field int AllPorts;                // =-1
                  // Public Instance Properties
   public field IEnumerator AcceptList{get; } 
   public field IEnumerator ConnectList{get; } 
// Public Instance Methods
   public method void AddPermission(NetworkAccess access, 
        TransportType transport, string hostName, 
        int portNumber);  
   public override method IPermission Copy();      // overrides CodeAccessPermission
   public override method void FromXml(            // overrides CodeAccessPermission
        System.Security.SecurityElement securityElement);  
   public override method IPermission Intersect(   // overrides CodeAccessPermission
        System.Security.IPermission target);  
   public override method bool IsSubsetOf(         // overrides CodeAccessPermission
        System.Security.IPermission target);  
   public method bool IsUnrestricted();            // implements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required