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); }
public static void Send(this IThreadSafeSocket socket, ref Msg msg) { var result = socket.TrySend(ref msg, SendReceiveConstants.InfiniteTimeout); Debug.Assert(result); }