Exemple #1
0
 public static T Create <T>(ProtocolDriver driver)
     where T : Message, new()
 {
     return(new T {
         Driver = driver
     });
 }
Exemple #2
0
        public static bool Send <T>(ProtocolDriver driver, Action <T> initMsg = null)
            where T : Message, new()
        {
            T _this = Create <T>(driver);

            if (initMsg != null)
            {
                initMsg(_this);
            }
            return(_this.Send());
        }
Exemple #3
0
        public static new Response Send <T>(ProtocolDriver driver, Action <T> initMsg = null)
            where T : Request, new()
        {
            T _this = Create <T>(driver);

            if (initMsg != null)
            {
                initMsg(_this);
            }
            return(_this.Send());
        }
        public static ProtocolDriver Create(IMessageEventSink sink)
        {
            var _this = new ProtocolDriver();

            return(_this.Initialize(sink) ? _this : null);
        }