Ejemplo n.º 1
0
        public void Donate(Cdb2ConnectionId connectionId, IntPtr handle)
        {
            var message = new V0Message
            {
                Type       = V0MessageType.Donate,
                TypeString = connectionId.ToString(),
                Timeout    = DefaultTimeout
            };
            var wrapper = new SockPoolMessage
            {
                Buffer = BitUtil.ToArray(message),
                Handle = handle
            };

            NativeUtil.SendMessage(_socket, wrapper);
        }
Ejemplo n.º 2
0
        public IntPtr Request(Cdb2ConnectionId connectionId)
        {
            var message = new V0Message
            {
                Type       = V0MessageType.Request,
                TypeString = connectionId.ToString()
            };
            var wrapper = new SockPoolMessage
            {
                Buffer = BitUtil.ToArray(message)
            };

            NativeUtil.SendMessage(_socket, wrapper);

            wrapper = NativeUtil.ReceiveMessage(_socket, 60);
            message = BitUtil.ToMessage <V0Message>(wrapper.Buffer);
            return(wrapper.Handle);
        }