• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ConnectionIOException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.subgraph.orchid.ConnectionIOException的典型用法代码示例。如果您正苦于以下问题:Java ConnectionIOException类的具体用法?Java ConnectionIOException怎么用?Java ConnectionIOException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConnectionIOException类属于com.subgraph.orchid包,在下文中一共展示了ConnectionIOException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sendCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
public void sendCell(Cell cell) throws ConnectionIOException  {
	if(!socket.isConnected()) {
		throw new ConnectionIOException("Cannot send cell because connection is not connected");
	}
	updateLastActivity();
	outputLock.lock();
	try {
		try {
			output.write(cell.getCellBytes());
		} catch (IOException e) {
			logger.fine("IOException writing cell to connection "+ e.getMessage());
			closeSocket();
			throw new ConnectionIOException(e.getClass().getName() + " : "+ e.getMessage());
		}
	} finally {
		outputLock.unlock();
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:19,代码来源:ConnectionImpl.java


示例2: runHandshake

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
void runHandshake() throws IOException, InterruptedException, ConnectionIOException {
	// Swap in V1-only ciphers for second handshake as a workaround for:
	//
	//     https://trac.torproject.org/projects/tor/ticket/4591
	// 
	socket.setEnabledCipherSuites(ConnectionSocketFactory.V1_CIPHERS_ONLY);
	
	final HandshakeFinishedMonitor monitor = new HandshakeFinishedMonitor();
	socket.addHandshakeCompletedListener(monitor);
	socket.startHandshake();
	monitor.waitFinished();
	socket.removeHandshakeCompletedListener(monitor);
	
	verifyIdentityKey(getIdentityKey());
	sendVersions(2);
	receiveVersions();
	sendNetinfo();
	recvNetinfo();
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:20,代码来源:ConnectionHandshakeV2.java


示例3: doConnect

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
private void doConnect() throws IOException, InterruptedException, ConnectionIOException {
	connectSocket();
	final ConnectionHandshake handshake = ConnectionHandshake.createHandshake(config, this, socket);
	input = socket.getInputStream();
	output = socket.getOutputStream();
	readCellsThread.start();
	handshake.runHandshake();
	updateLastActivity();
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:10,代码来源:ConnectionImpl.java


示例4: readConnectionControlCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
Cell readConnectionControlCell() throws ConnectionIOException {
	try {
		return connectionControlCells.take();
	} catch (InterruptedException e) {
		closeSocket();
		throw new ConnectionIOException();
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:9,代码来源:ConnectionImpl.java


示例5: runHandshake

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
void runHandshake() throws IOException, InterruptedException, ConnectionIOException {
	sendVersions(3);
	receiveVersions();
	recvCerts();
	recvAuthChallengeAndNetinfo();
	verifyCertificates();
	sendNetinfo();
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:9,代码来源:ConnectionHandshakeV3.java


示例6: expectCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
protected Cell expectCell(Integer... expectedTypes) throws ConnectionHandshakeException {
	try {
		final Cell c = connection.readConnectionControlCell();
		for(int t: expectedTypes) {
			if(c.getCommand() == t) {
				return c;
			}
		}
		final List<Integer> expected = Arrays.asList(expectedTypes);
		throw new ConnectionHandshakeException("Expecting Cell command "+ expected + " and got [ "+ c.getCommand() +" ] instead");
	} catch (ConnectionIOException e) {
		throw new ConnectionHandshakeException("Connection exception while performing handshake "+ e);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:15,代码来源:ConnectionHandshake.java


示例7: sendVersions

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
protected  void sendVersions(int... versions) throws ConnectionIOException {
	final Cell cell = CellImpl.createVarCell(0, Cell.VERSIONS, versions.length * 2);
	for(int v: versions) {
		cell.putShort(v);
	}
	connection.sendCell(cell);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:ConnectionHandshake.java


示例8: sendNetinfo

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
protected void sendNetinfo() throws ConnectionIOException {
	final Cell cell = CellImpl.createCell(0, Cell.NETINFO);
	putTimestamp(cell);
	putIPv4Address(cell, connection.getRouter().getAddress());
	putMyAddresses(cell);
	connection.sendCell(cell);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:ConnectionHandshake.java


示例9: sendCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
void sendCell(Cell cell) {
	final CircuitStatus status = circuit.getStatus();
	if(!(status.isConnected() || status.isBuilding()))
		return;
	try {
		status.updateDirtyTimestamp();
		connection.sendCell(cell);
	} catch (ConnectionIOException e) {
		destroyCircuit();
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:12,代码来源:CircuitIO.java


示例10: sendDestroyCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
void sendDestroyCell(int reason) {
	Cell destroy = CellImpl.createCell(circuitId, Cell.DESTROY);
	destroy.putByte(reason);
	try {
		connection.sendCell(destroy);
	} catch (ConnectionIOException e) {
		logger.warning("Connection IO error sending DESTROY cell: "+ e.getMessage());
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:10,代码来源:CircuitIO.java


示例11: sendCell

import com.subgraph.orchid.ConnectionIOException; //导入依赖的package包/类
public void sendCell(Cell cell) throws ConnectionIOException  {
	if(!socket.isConnected()) {
		throw new ConnectionIOException("Cannot send cell because connection is not connected");
	}
	updateLastActivity();
	synchronized(output) {
		try {
			output.write(cell.getCellBytes());
		} catch (IOException e) {
			logger.fine("IOException writing cell to connection "+ e.getMessage());
			closeSocket();
			throw new ConnectionIOException(e.getClass().getName() + " : "+ e.getMessage());
		}
	}
}
 
开发者ID:HashEngineering,项目名称:quarkcoinj,代码行数:16,代码来源:ConnectionImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WSDLOutput类代码示例发布时间:2022-05-23
下一篇:
Java XMLStreamWriterUtil类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap