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

Java StreamConnectFailedException类代码示例

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

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



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

示例1: getStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
Stream getStream() throws OpenFailedException, TimeoutException, StreamConnectFailedException, InterruptedException {
	synchronized(requestCompletionLock) {
		switch(completionStatus) {
		case NOT_COMPLETED:
			throw new IllegalStateException("Request not completed");
		case EXIT_FAILURE:
			throw new OpenFailedException("Failure at exit node");
		case TIMEOUT:
			throw new TimeoutException();
		case STREAM_OPEN_FAILURE:
			throw new StreamConnectFailedException(streamOpenFailReason);
		case INTERRUPTED:
			throw new InterruptedException();
		case SUCCESS:
			return stream;
		default:
			throw new IllegalStateException("Unknown completion status");
		}
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:21,代码来源:StreamExitRequest.java


示例2: waitForRelayConnected

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
private void waitForRelayConnected(long timeout) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	final long start = System.currentTimeMillis();
	long elapsed = 0;
	synchronized(waitConnectLock) {
		while(!relayConnectedReceived) {

			if(relayEndReceived) {
				throw new StreamConnectFailedException(relayEndReason);
			}

			if(elapsed >= timeout) {
				throw new TimeoutException();
			}

			waitConnectLock.wait(timeout - elapsed);
			
			elapsed = System.currentTimeMillis() - start;
		}
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:21,代码来源:StreamImpl.java


示例3: openDirectoryStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
private Stream openDirectoryStream(int purpose) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	final int requestEventCode = purposeToEventCode(purpose, false);
	final int loadingEventCode = purposeToEventCode(purpose, true);
	
	notifyInitialization(requestEventCode);

	final Stream stream = circuit.openDirectoryStream(OPEN_DIRECTORY_STREAM_TIMEOUT, true);
	notifyInitialization(loadingEventCode);
	return stream;
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:DirectoryDocumentRequestor.java


示例4: processStreamOpenException

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
protected Stream processStreamOpenException(Exception e) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	if(e instanceof InterruptedException) {
		throw (InterruptedException) e;
	} else if(e instanceof TimeoutException) {
		throw(TimeoutException) e;
	} else if(e instanceof StreamConnectFailedException) {
		throw(StreamConnectFailedException) e;
	} else {
		throw new IllegalStateException();
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:12,代码来源:CircuitImpl.java


示例5: openDirectoryStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
public Stream openDirectoryStream(long timeout, boolean autoclose) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	if(type != InternalType.HS_DIRECTORY) {
		throw new IllegalStateException("Cannot open directory stream on internal circuit with type "+ type);
	}
	final StreamImpl stream = createNewStream();
	try {
		stream.openDirectory(timeout);
		return stream;
	} catch (Exception e) {
		removeStream(stream);
		return processStreamOpenException(e);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:14,代码来源:InternalCircuitImpl.java


示例6: openStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
public Stream openStream(int port, long timeout) 
		throws InterruptedException, TimeoutException, StreamConnectFailedException {
	if(type != InternalType.HS_CIRCUIT) {
		throw new IllegalStateException("Cannot open stream to hidden service from internal circuit type "+ type);
	}
	final StreamImpl stream = createNewStream();
	try {
		stream.openExit("", port, timeout);
		return stream;
	} catch (Exception e) {
		removeStream(stream);
		return processStreamOpenException(e);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:15,代码来源:InternalCircuitImpl.java


示例7: openExitStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
public Stream openExitStream(String target, int port, long timeout) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	final StreamImpl stream = createNewStream();
	try {
		stream.openExit(target, port, timeout);
		return stream;
	} catch (Exception e) {
		removeStream(stream);
		return processStreamOpenException(e);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:ExitCircuitImpl.java


示例8: openDirectoryStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
public Stream openDirectoryStream(long timeout, boolean autoclose) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	final StreamImpl stream = createNewStream(autoclose);
	try {
		stream.openDirectory(timeout);
		return stream;
	} catch (Exception e) {
		removeStream(stream);
		return processStreamOpenException(e);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:DirectoryCircuitImpl.java


示例9: openExit

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
void openExit(String target, int port, long timeout) throws InterruptedException, TimeoutException, StreamConnectFailedException {
	streamTarget = target + ":"+ port;
	final RelayCell cell = new RelayCellImpl(circuit.getFinalCircuitNode(), circuit.getCircuitId(), streamId, RelayCell.RELAY_BEGIN);
	cell.putString(target + ":"+ port);
	circuit.sendRelayCellToFinalNode(cell);
	waitForRelayConnected(timeout);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:StreamImpl.java


示例10: tryOpenExitStream

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
private Stream tryOpenExitStream() throws InterruptedException, TimeoutException, StreamConnectFailedException {
	if(exitRequest.isAddressTarget()) {
		return circuit.openExitStream(exitRequest.getAddress(), exitRequest.getPort(), exitRequest.getStreamTimeout());
	} else {
		return circuit.openExitStream(exitRequest.getHostname(), exitRequest.getPort(), exitRequest.getStreamTimeout());
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:OpenExitStreamTask.java


示例11: getStreamTo

import com.subgraph.orchid.StreamConnectFailedException; //导入依赖的package包/类
public Stream getStreamTo(String onion, int port) throws OpenFailedException, InterruptedException, TimeoutException {
	final HiddenService hs = getHiddenServiceForOnion(onion);
	final HiddenServiceCircuit circuit = getCircuitTo(hs);
	
	try {
		return circuit.openStream(port, HS_STREAM_TIMEOUT);
	} catch (StreamConnectFailedException e) {
		throw new OpenFailedException("Failed to open stream to hidden service "+ hs.getOnionAddressForLogging() + " reason "+ e.getReason());
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:HiddenServiceManager.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java UnregisteredDriver类代码示例发布时间:2022-05-23
下一篇:
Java DOMDocumentParser类代码示例发布时间: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