本文整理汇总了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;
}
}
示例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);
}
示例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);
}
}
示例4: deliverControlCell
import com.subgraph.orchid.Cell; //导入方法依赖的package包/类
void deliverControlCell(Cell cell) {
if(cell.getCommand() == Cell.DESTROY) {
processDestroyCell(cell.getByte());
} else {
controlCellResponseQueue.add(cell);
}
}
示例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());
}