public static Session <S, E, P> SendAsync <S, E, P, T>(this Session <Send <T, S>, E, P> session, T value, out Task task) where S : SessionType where E : SessionStack where P : ProtocolType { if (session is null) { throw new ArgumentNullException(nameof(session)); } task = session.SendAsync(value); return(session.ToNextSession <S>()); }
public static Session <S, E, P> SendAsync <S, E, P>(this Session <Send <S>, E, P> session) where S : SessionType where E : SessionStack where P : ProtocolType { if (session is null) { throw new ArgumentNullException(nameof(session)); } session.SendAsync(); return(session.ToNextSession <S>()); }