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


Java Cell.getCommand方法代码示例

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


在下文中一共展示了Cell.getCommand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processCell

import com.subgraph.orchid.Cell; //导入方法依赖的package包/类
private void processCell(Cell cell) {
	updateLastActivity();
	final int command = cell.getCommand();

	if(command == Cell.RELAY) {
		processRelayCell(cell);
		return;
	}

	switch(command) {
	case Cell.NETINFO:
	case Cell.VERSIONS:
	case Cell.CERTS:
	case Cell.AUTH_CHALLENGE:
		connectionControlCells.add(cell);
		break;

	case Cell.CREATED:
	case Cell.CREATED_FAST:
	case Cell.DESTROY:
		processControlCell(cell);
		break;
	default:
		// Ignore everything else
		break;
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:28,代码来源:ConnectionImpl.java

示例2: recvAuthChallengeAndNetinfo

import com.subgraph.orchid.Cell; //导入方法依赖的package包/类
void recvAuthChallengeAndNetinfo() throws ConnectionHandshakeException {
	final Cell cell = expectCell(Cell.AUTH_CHALLENGE, Cell.NETINFO);
	if(cell.getCommand() == Cell.NETINFO) {
		processNetInfo(cell);
		return;
	}
	final Cell netinfo = expectCell(Cell.NETINFO);
	processNetInfo(netinfo);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:10,代码来源:ConnectionHandshakeV3.java

示例3: expectCell

import com.subgraph.orchid.Cell; //导入方法依赖的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

示例4: deliverControlCell

import com.subgraph.orchid.Cell; //导入方法依赖的package包/类
void deliverControlCell(Cell cell) {
	if(cell.getCommand() == Cell.DESTROY) {
		processDestroyCell(cell.getByte());
	} else {
		controlCellResponseQueue.add(cell);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:CircuitIO.java

示例5: createFromCell

import com.subgraph.orchid.Cell; //导入方法依赖的package包/类
public static RelayCell createFromCell(CircuitNode node, Cell cell) {
	if(cell.getCommand() != Cell.RELAY)
		throw new TorException("Attempted to create RelayCell from Cell type: "+ cell.getCommand());
	return new RelayCellImpl(node, cell.getCellBytes());
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:6,代码来源:RelayCellImpl.java


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