Name
SocketPermission
Synopsis
This class is a
java.security.Permission that governs all
networking operations performed with sockets. Like all permissions, a
SocketPermission consists of a name, or target,
and a list of actions that may be performed on that target. The
target of a SocketPermission is the host and,
optionally, the port or ports for which permission is being granted
or requested. The target consists of a hostname optionally followed
by a colon and a port specification. The host may be a DNS domain
name, a numerical IP address, or the string
“localhost”. If you specify a host
domain name, you may use * as a wildcard as the
leftmost portion of the hostname. The port specification, if present,
must be a single port number or a range of port numbers in the form
n1-n2. If n1 is omitted, it is
taken to be 0, and if n2 is
omitted, it is taken to be 65535. If no port is
specified, the socket permission applies to all ports of the
specified host. Here are some legal
SocketPermission targets:
java.sun.com:80 *.sun.com:1024-2000 *:1024- localhost:-1023
In addition to a target, each SocketPermission must have a comma-separated list of actions, which specify the operations that may be performed on the specified host(s) and port(s). The available actions are “connect”, “accept”, “listen”, and “resolve”. “connect” represents permission to connect to the specified target. “accept” indicates permission to accept connections from the specified target. “listen” represents permission ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access