本文整理了Java中java.net.Socket.checkDestination()
方法的一些代码示例,展示了Socket.checkDestination()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Socket.checkDestination()
方法的具体详情如下:
包路径:java.net.Socket
类名称:Socket
方法名:checkDestination
[英]Checks whether the connection destination satisfies the security policy and the validity of the port range.
[中]检查连接目标是否满足安全策略和端口范围的有效性。
代码示例来源:origin: robovm/robovm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: robovm/robovm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: robovm/robovm
/**
* Creates a new streaming or datagram socket connected to the target host
* specified by the parameters {@code addr} and {@code port}. The socket is
* bound to any available port on the local host.
*
* @param addr
* the Internet address to connect to.
* @param port
* the port on the target host to connect to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws IOException
* if an error occurs while creating the socket.
* @deprecated Use {@code Socket(InetAddress, int)} instead of this for
* streaming sockets or an appropriate constructor of {@code
* DatagramSocket} for UDP transport.
*/
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
代码示例来源:origin: robovm/robovm
dstAddress = dstAddresses[i];
try {
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, streaming);
return;
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, streaming);
代码示例来源:origin: robovm/robovm
checkDestination(addr, port);
synchronized (connectLock) {
try {
代码示例来源:origin: MobiVM/robovm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: ibinti/bugvm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: FlexoVM/flexovm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. The socket is
* bound to any available port on the local host.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
代码示例来源:origin: ibinti/bugvm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: ibinti/bugvm
/**
* Creates a new streaming or datagram socket connected to the target host
* specified by the parameters {@code addr} and {@code port}. The socket is
* bound to any available port on the local host.
*
* @param addr
* the Internet address to connect to.
* @param port
* the port on the target host to connect to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws IOException
* if an error occurs while creating the socket.
* @deprecated Use {@code Socket(InetAddress, int)} instead of this for
* streaming sockets or an appropriate constructor of {@code
* DatagramSocket} for UDP transport.
*/
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
代码示例来源:origin: MobiVM/robovm
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: MobiVM/robovm
/**
* Creates a new streaming or datagram socket connected to the target host
* specified by the parameters {@code addr} and {@code port}. The socket is
* bound to any available port on the local host.
*
* @param addr
* the Internet address to connect to.
* @param port
* the port on the target host to connect to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws IOException
* if an error occurs while creating the socket.
* @deprecated Use {@code Socket(InetAddress, int)} instead of this for
* streaming sockets or an appropriate constructor of {@code
* DatagramSocket} for UDP transport.
*/
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Creates a new streaming or datagram socket connected to the target host
* specified by the parameters {@code addr} and {@code port}. The socket is
* bound to any available port on the local host.
*
* @param addr
* the Internet address to connect to.
* @param port
* the port on the target host to connect to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws IOException
* if an error occurs while creating the socket.
* @deprecated Use {@code Socket(InetAddress, int)} instead of this for
* streaming sockets or an appropriate constructor of {@code
* DatagramSocket} for UDP transport.
*/
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Creates a new streaming socket connected to the target host specified by
* the parameters {@code dstAddress} and {@code dstPort}. On the local
* endpoint the socket is bound to the given address {@code localAddress} on
* port {@code localPort}.
*
* @param dstAddress
* the target host address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @throws IOException
* if an error occurs while creating the socket.
*/
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Creates a new streaming or datagram socket connected to the target host
* specified by the parameters {@code addr} and {@code port}. The socket is
* bound to any available port on the local host.
*
* @param addr
* the Internet address to connect to.
* @param port
* the port on the target host to connect to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws IOException
* if an error occurs while creating the socket.
* @deprecated Use {@code Socket(InetAddress, int)} instead of this for
* streaming sockets or an appropriate constructor of {@code
* DatagramSocket} for UDP transport.
*/
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
内容来源于网络,如有侵权,请联系作者删除!