Package java.net

Examples of java.net.SocketPermission$EphemeralRange


   * @param context
   *            Object the security context to use for the check.
   */
  public void checkConnect(String host, int port, Object context) {
    if (port > 0) {
            checkPermission(new SocketPermission(host + ':' + port, "connect"),
          context);
        } else {
            checkPermission(new SocketPermission(host, "resolve"), context);
        }
  }
View Full Code Here


   * @param port
   *            int the port number to check
   */
  public void checkListen(int port) {
    if (port == 0) {
            checkPermission(new SocketPermission("localhost:1024-",
          "listen"));
        } else {
            checkPermission(new SocketPermission("localhost:" + port,
          "listen"));
        }
  }
View Full Code Here

  /**
   * Checks whether the running program is allowed to join, leave or send to a
   * multicast address.
   */
  public void checkMulticast(InetAddress maddr) {
    checkPermission(new SocketPermission(maddr.getHostAddress(),
        "accept,connect"));
  }
View Full Code Here

   *
   * @deprecated use SecurityManager#checkMulticast(java.net.InetAddress)
   */
  @Deprecated
    public void checkMulticast(InetAddress maddr, byte ttl) {
    checkPermission(new SocketPermission(maddr.getHostAddress(),
        "accept,connect"));
  }
View Full Code Here

   */
  public void checkAccept(String host, int port) {
    if (host == null) {
            throw new NullPointerException();
        }
    checkPermission(new SocketPermission(host + ':' + port, "accept"));
  }
View Full Code Here

  public void checkConnect(String host, int port) {
    if (host == null) {
            throw new NullPointerException();
        }
    if (port > 0) {
            checkPermission(new SocketPermission(host + ':' + port, "connect"));
        } else {
            checkPermission(new SocketPermission(host, "resolve"));
        }
  }
View Full Code Here

                     * accepting connections from it should be added.
                     */
                    String host = urls[i].getHost();

                    if (host != null) {
                        perms.add(new SocketPermission(host,
                                "connect, accept")); //$NON-NLS-1$
                    }
                }
            }
        }
View Full Code Here

     */
    public void checkAccept(String host, int port) {
        if (host == null) {
            throw new NullPointerException();
        }
        checkPermission(new SocketPermission(host + ':' + port, "accept")); //$NON-NLS-1$
    }
View Full Code Here

    public void checkConnect(String host, int port) {
        if (host == null) {
            throw new NullPointerException();
        }
        if (port > 0) {
            checkPermission(new SocketPermission(host + ':' + port, "connect")); //$NON-NLS-1$
        } else {
            checkPermission(new SocketPermission(host, "resolve")); //$NON-NLS-1$
        }
    }
View Full Code Here

     * @param context
     *            Object the security context to use for the check.
     */
    public void checkConnect(String host, int port, Object context) {
        if (port > 0) {
            checkPermission(new SocketPermission(host + ':' + port, "connect"), //$NON-NLS-1$
                    context);
        } else {
            checkPermission(new SocketPermission(host, "resolve"), context); //$NON-NLS-1$
        }
    }
View Full Code Here

TOP

Related Classes of java.net.SocketPermission$EphemeralRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.