本文整理汇总了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;未经允许,请勿转载。 |
请发表评论