예제 #1
0
파일: BBuffer.cs 프로젝트: marcarvalho/byps
 public static BBuffer create(BBinaryModel bmodel, ByteBuffer buf)
 {
     if (bmodel == BBinaryModel.MEDIUM)
     {
         return new BBufferBin(bmodel, buf);
     }
     throw new InvalidOperationException();
 }
예제 #2
0
 public static BBuffer create(BBinaryModel bmodel, ByteBuffer buf)
 {
     if (bmodel == BBinaryModel.MEDIUM)
     {
         return(new BBufferBin(bmodel, buf));
     }
     throw new InvalidOperationException();
 }
예제 #3
0
 public BRegistry getRegistry(BBinaryModel bmodel)
 {
     BRegistry ret = null;
     if (!registries.TryGetValue(bmodel, out ret))
     {
         throw new InvalidOperationException("No registry for protocol=" + bmodel);
     }
     return ret;
 }
예제 #4
0
        public BRegistry getRegistry(BBinaryModel bmodel)
        {
            BRegistry ret = null;

            if (!registries.TryGetValue(bmodel, out ret))
            {
                throw new InvalidOperationException("No registry for protocol=" + bmodel);
            }
            return(ret);
        }
예제 #5
0
	    private void internalTestPerformance(BBinaryModel bmodel, int gzip, int loopCount, int objCount) 
        {
		    BClient_Testser client = TestUtilsHttp.createClient();

		    PrimitiveTypes[] primitiveTypes1 = new PrimitiveTypes[objCount];
		    for (int i = 0; i < primitiveTypes1.Length; i++) {
			    primitiveTypes1[i] = TestUtils.createObjectPrimitiveTypes();
		    }
		
		    long t1 = DateTime.Now.Ticks;
		    for (int i = 0; i < loopCount; i++) {
			    client.RemoteArrayTypes1dim.SetPrimitiveTypes(primitiveTypes1);
		    }
		    long t2 = DateTime.Now.Ticks;
		
		    long t3 = DateTime.Now.Ticks;
		    for (int i = 0; i < loopCount; i++) {
			    client.RemoteArrayTypes1dim.GetPrimitiveTypes();
		    }
		    long t4 = DateTime.Now.Ticks;
		
		    client.done();

            t1 /= 10000;
            t2 /= 10000;
            t3 /= 10000;
            t4 /= 10000;
		
		    log.info("bmodel=" + bmodel.ToString().Substring(0,2) +
				    ", gzip=" + gzip + 
				    ", #objs=" + objCount.ToString("000000") +
                    ", #loops=" + loopCount.ToString("000000") +
                    ", call-ms=" + ((t2 - t1) + (t4 - t3)).ToString("000000") +
                    "/" + (t2 - t1).ToString("000000") +
                    "/" + (t4 - t3).ToString("000000")
                    );
		
	    }
예제 #6
0
 public BRegistry(BBinaryModel bmodel)
 {
     this.bmodel = bmodel;
 }
예제 #7
0
 internal BBufferBin(BBinaryModel bmodel, ByteBuffer buf)
 {
     this.bmodel = bmodel;
     this.buf = buf != null ? buf : ByteBuffer.allocate(10 * 1000);
 }
예제 #8
0
 public virtual int size(Object obj1, BBinaryModel bmodel)
 {
     return 0;
 }
예제 #9
0
 public BRegistry(BBinaryModel bmodel)
 {
     this.bmodel = bmodel;
 }
예제 #10
0
 public virtual int size(Object obj1, BBinaryModel bmodel)
 {
     return(0);
 }
예제 #11
0
 internal BBufferBin(BBinaryModel bmodel, ByteBuffer buf)
 {
     this.bmodel = bmodel;
     this.buf    = buf != null ? buf : ByteBuffer.allocate(10 * 1000);
 }