本文整理汇总了Java中sun.net.NetworkClient类的典型用法代码示例。如果您正苦于以下问题:Java NetworkClient类的具体用法?Java NetworkClient怎么用?Java NetworkClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NetworkClient类属于sun.net包,在下文中一共展示了NetworkClient类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultConnectTimeout
import sun.net.NetworkClient; //导入依赖的package包/类
static int getDefaultConnectTimeout() {
return NetworkClient.defaultConnectTimeout;
}
示例2: afterConnect
import sun.net.NetworkClient; //导入依赖的package包/类
@Override @SuppressWarnings("resource")
public void afterConnect() throws IOException,
UnknownHostException {
if (!isCachedConnection()) {
SSLSocket sslsocket = null;
SSLSocketFactory sslsocketfactory = _sslSocketFactory;
try {
if (!(super.serverSocket instanceof SSLSocket)) {
sslsocket = (SSLSocket) sslsocketfactory.createSocket(super.serverSocket, super.host, super.port, true);
} else {
sslsocket = (SSLSocket) super.serverSocket;
}
} catch (IOException ioexception) {
try {
sslsocket = (SSLSocket) sslsocketfactory.createSocket(super.host, super.port);
} catch (IOException ioexception1) {
throw ioexception;
}
}
// SSLSocketFactoryImpl.checkCreate(sslsocket);
String protocols[] = _getProtocols();
String ciphers[] = _getCipherSuites();
if (protocols != null) {
sslsocket.setEnabledProtocols(protocols);
}
if (ciphers != null) {
sslsocket.setEnabledCipherSuites(ciphers);
}
sslsocket.addHandshakeCompletedListener(this);
sslsocket.startHandshake();
_sslSession = sslsocket.getSession();
super.serverSocket = sslsocket;
try {
super.serverOutput = new PrintStream(new BufferedOutputStream(super.serverSocket.getOutputStream()), false, NetworkClient.encoding);
} catch (UnsupportedEncodingException unsupportedencodingexception) {
throw new InternalError(NetworkClient.encoding + " encoding not found");
}
this.checkURLSpoofing(_hostNameVerifier);
} else {
_sslSession = ((SSLSocket) super.serverSocket).getSession();
}
}
示例3: GopherInputStream
import sun.net.NetworkClient; //导入依赖的package包/类
GopherInputStream(NetworkClient o, InputStream fd) {
super(fd);
parent = o;
}