Esempio n. 1
0
        public void Receive(uint minimumIncompleteLength, uint maximumLength, NWConnectionReceiveCompletion callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException(nameof(callback));
            }

            BlockLiteral block_handler = new BlockLiteral();

            block_handler.SetupBlockUnsafe(static_ReceiveCompletion, callback);
            try {
                nw_connection_receive(GetCheckedHandle(), minimumIncompleteLength, maximumLength, ref block_handler);
            } finally {
                block_handler.CleanupBlock();
            }
        }
Esempio n. 2
0
        public void ReceiveMessage(NWConnectionReceiveCompletion callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException(nameof(callback));
            }

            BlockLiteral block_handler = new BlockLiteral();

            block_handler.SetupBlockUnsafe(static_ReceiveCompletion, callback);

            try {
                nw_connection_receive_message(GetCheckedHandle(), ref block_handler);
            } finally {
                block_handler.CleanupBlock();
            }
        }