Exemplo n.º 1
0
        public Rudp(SharpC sharpc, int send_delay, int expired_time)
        {
            _sharpc = sharpc;

            SharpC.CSObject cso0 = sharpc.CacheObj(this);
            SharpC.CSObject cso1 = sharpc.CacheFunc(RSend);
            SharpC.CSObject cso2 = sharpc.CacheFunc(RRecv);

            _u = Rudp_CSharp.rudpaux_alloc(send_delay, expired_time, cso0, cso1, cso2);

            _buffer = Marshal.AllocHGlobal(3072);

            _sendBuffer = new byte[3072];
            _recvBuffer = new byte[3072];
        }
Exemplo n.º 2
0
        public Rudp(SharpC sharpc, int send_delay, int expired_time)
        {
            _sharpc = sharpc;

            SharpC.CSObject cso0 = SharpC.CacheObj(this);
            SharpC.CSObject cso1 = SharpC.CacheFunc(RSend);
            SharpC.CSObject cso2 = SharpC.CacheFunc(RRecv);
            SharpC.CSObject cso3 = new SharpC.CSObject();
            cso3.type = SharpC.CSType.INTPTR;
            cso3.ptr  = _sharpc.CPtr;

            _u = Rudp_CSharp.rudpaux_alloc(send_delay, expired_time, cso3, cso0, cso1, cso2);

            _buffer = Marshal.AllocHGlobal(3072); // 单线程

            _sendBuffer = new byte[3072];
            _recvBuffer = new byte[3072];
        }