当前位置: 首页>>代码示例>>Java>>正文


Java NetworkClient类代码示例

本文整理汇总了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;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:4,代码来源:HttpsClient.java

示例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();
	}
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:43,代码来源:HttpsClient.java

示例3: GopherInputStream

import sun.net.NetworkClient; //导入依赖的package包/类
GopherInputStream(NetworkClient o, InputStream fd) {
    super(fd);
    parent = o;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:5,代码来源:GopherClient.java


注:本文中的sun.net.NetworkClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。