Microsoft SDK for Java

addHost

The addHost method of the NetIOPermission Class contains the following signatures:

addHost(int flags, String hostspec)
addHost(int flags, String hostspec, IntRanges ports)

addHost(int flags, String hostspec)

Adds a hostname pattern to the permissions with no port rules. The permission will allow access to all ports, unless global rules have been previously specified.

Syntax

public void addHost(int flags, String hostspec);

Parameters

flags The access flags, which consist of two separate flags combined with a logical OR operator (|). The first flag should be BIND, CONNECT, MULTICAST, or ALL_API_FLAGS to specify the connection type. The second flag should be either ALLOW or DENY to indicate whether the 32-bit address range being added should use the include or exclude rules. For convenience, instead using the logical OR operator with the two flags, you can use one of the combination flags: ALLOWALL, DENYALL, ALLOWCONNECT, DENYCONNECT, ALLOWBIND, DENYBIND, ALLOWMULTICAST, or DENYMULTICAST.
hostspec The host specification.

addHost(int flags, String hostspec, IntRanges ports)

Adds a hostname pattern to the permissions with the specified port rules.

Syntax

public void addHost(int flags, String hostspec, IntRanges ports);

Parameters

flags The access flags, which consist of two separate flags combined with a logical OR operator (|). The first flag should be either BIND or CONNECT to specify the connection type. The second flag should be either ALLOW or DENY to indicate whether the hostname pattern being added should use the include or exclude rules. For convenience, instead of using the logical OR operator with the two flags, you can use one of the combination flags: ALLOWALL, DENYALL, ALLOWCONNECT, DENYCONNECT, ALLOWBIND, or DENYBIND.
hostspec The host specification.
ports The ports that apply to the hosts.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.