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


Java NetResponseSchema.MSG_CONTINUATION_102属性代码示例

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


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

示例1: consumeAllResults

private boolean consumeAllResults(long now) {
	boolean didWork = false;
	int i;
	int usr = usersPerPipe;
	while (--usr >= 0) {
	
		i = inputs.length;
		while (--i>=0) {

			Pipe<NetResponseSchema> pipe = inputs[i];
			
			while (Pipe.hasContentToRead(pipe)) {
				
				didWork=true;
								
				final int msg = Pipe.takeMsgIdx(pipe);
				
				switch (msg) {
					case NetResponseSchema.MSG_RESPONSE_101:
					case NetResponseSchema.MSG_CONTINUATION_102:
							
						long conId = Pipe.takeLong(pipe);
						int flags = Pipe.takeInt(pipe);
						
						//TODO: this is a serious issue we request on 1 pipe but they come back on another....
						int userIdx = userIdFromConnectionId[(int)conId];
						
						int meta = Pipe.takeRingByteMetaData(inputs[i]); //TODO: DANGER, write helper method that does this for low level users.
						int len = Pipe.takeRingByteLen(pipe);
						int pos = Pipe.bytePosition(meta, pipe, len);
						
						//TODO: test data is missing these values, must set...
						//if (0 != (ServerCoordinator.END_RESPONSE_MASK&flags)) {
						
							totalReceived++;
							if (--toRecieve[userIdx]==0) {
								if (--shutdownCount == 0) {
									//logger.trace("full shutdown now {}",shutdownCount);
									requestShutdown();
									break;
								}
								
								//logger.trace("shutdown remaining {} for user {}",shutdownCount,userId);
							}
						//}
						
						if (false) {									
							testExpectedValues(i, len, pos);
						}
						
						break;
					case NetResponseSchema.MSG_CLOSED_10:
						
						int meta2 = Pipe.takeRingByteMetaData(pipe);
						int len2 = Pipe.takeRingByteLen(pipe);
						Pipe.bytePosition(meta2, pipe, len2);
						
						Pipe.takeInt(pipe);
						break;
					case -1:
						//EOF
						break;
					default:
						throw new UnsupportedOperationException(msg+"  "+pipe.toString());
				}
				Pipe.confirmLowLevelRead(pipe, Pipe.sizeOf(NetResponseSchema.instance, msg));
				Pipe.releaseReadLock(pipe);
							
				lastTime = now;			

			}	
			
			
			
		}
	}
	return didWork;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:78,代码来源:RegulatedLoadTestStage.java


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