Microsoft SDK for Java

checkConnect

The checkConnect method of the StandardSecurityManager Class contains the following signatures:

checkConnect(String host, int port)
checkConnect(String host, int port, Object context)

checkConnect(String host, int port)

Determines whether classes within the current execution context, based on the call stack of the current thread, can open a socket connection to the specified host on the specified port.

Syntax

public synchronized void checkConnect(String host, int port);

Parameters

host The host.
port The port.

Remarks

The check succeeds only if all the classes found on the call stack possess NetIOPermissions, and if those permissions allow connections to the specified host and port. This method overrides the java.lang.SecurityManager.checkConnect(String,int) method.

Exceptions

SecurityException if the security check fails.

checkConnect(String host, int port, Object context)

Determines whether classes within the current execution context, based on the call stack of the current thread, can open a socket connection to the specified host on the specified port. This method overrides the java.lang.SecurityManager.checkConnect(String,int) method.

Syntax

public void checkConnect(String host, int port, Object context);

Note   The context parameter is ignored, and this method simply forwards the check to the checkConnect(String host,int port) method.

Parameters

host The host.
port The port.
context This parameter is ignored.

Exceptions

SecurityException if the security check fails.

See Also

checkConnect(String,int)

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