예제 #1
0
        public static void Receive(this IThreadSafeSocket socket, ref Msg msg, CancellationToken cancellationToken = default)
        {
            var result = socket.TryReceive(ref msg, SendReceiveConstants.InfiniteTimeout, cancellationToken);

            if (!result)
            {
                cancellationToken.ThrowIfCancellationRequested();
            }

            Debug.Assert(result);
        }
예제 #2
0
        public static void Send(this IThreadSafeSocket socket, ref Msg msg)
        {
            var result = socket.TrySend(ref msg, SendReceiveConstants.InfiniteTimeout);

            Debug.Assert(result);
        }