コード例 #1
0
        public override Session Connect(string senderName, Connection connection, TemplateRegistry inboundRegistry, TemplateRegistry outboundRegistry, MessageListener messageListener, SessionListener sessionListener)
        {
            var session = new Session(connection, this, TemplateRegistry_Fields.NULL, TemplateRegistry_Fields.NULL);

            session.MessageOutputStream.WriteMessage(CreateHelloMessage(senderName));
            Message message    = session.MessageInputStream.ReadMessage();
            string  serverName = message.GetString(1);

            session.Client = new BasicClient(serverName, "unknown");
            return(session);
        }
コード例 #2
0
        public override Session Connect(string senderName, Connection connection, TemplateRegistry inboundRegistry, TemplateRegistry outboundRegistry, MessageListener messageListener, SessionListener sessionListener)
        {
            var session = new Session(connection, this, TemplateRegistry_Fields.NULL, TemplateRegistry_Fields.NULL);

            session.MessageOutputStream.WriteMessage(CreateHelloMessage(senderName));
            try
            {
                System.Threading.Thread.Sleep(new TimeSpan((Int64)10000 * 20));
            }
            catch (System.Threading.ThreadInterruptedException)
            {
            }
            var    message    = session.MessageInputStream.ReadMessage();
            string serverName = message.GetString(1);
            string vendorId   = message.IsDefined(2)?message.GetString(2):"unknown";

            session.Client = new BasicClient(serverName, vendorId);
            return(session);
        }
コード例 #3
0
        public virtual MessageTemplate CreateTemplateFromMessage(Message templateDef, TemplateRegistry registry)
        {
            string name = templateDef.GetString("Name");

            Field[] fields = GroupConverter.ParseFieldInstructions(templateDef, registry, initialContext);
            return(new MessageTemplate(name, fields));
        }
コード例 #4
0
 public virtual void  RegisterSessionTemplates(TemplateRegistry registry)
 {
     registry.RegisterAll(TEMPLATE_REGISTRY);
 }
コード例 #5
0
 public virtual void  RegisterSessionTemplates(TemplateRegistry registry)
 {
     registry.Register(FAST_HELLO_TEMPLATE_ID, FAST_HELLO_TEMPLATE);
     registry.Register(FAST_ALERT_TEMPLATE_ID, FAST_ALERT_TEMPLATE);
     registry.Register(FAST_RESET_TEMPLATE_ID, FAST_RESET_TEMPLATE);
 }
コード例 #6
0
 public virtual void RegisterSessionTemplates(TemplateRegistry registry)
 {
     registry.Register(FAST_HELLO_TEMPLATE_ID, FAST_HELLO_TEMPLATE);
     registry.Register(FAST_ALERT_TEMPLATE_ID, FAST_ALERT_TEMPLATE);
     registry.Register(FAST_RESET_TEMPLATE_ID, FAST_RESET_TEMPLATE);
 }
コード例 #7
0
 public override Session Connect(string senderName, Connection connection, TemplateRegistry inboundRegistry, TemplateRegistry outboundRegistry, MessageListener messageListener, SessionListener sessionListener)
 {
     var session = new Session(connection, this, TemplateRegistry_Fields.NULL, TemplateRegistry_Fields.NULL);
     session.MessageOutputStream.WriteMessage(CreateHelloMessage(senderName));
     Message message = session.MessageInputStream.ReadMessage();
     string serverName = message.GetString(1);
     session.Client = new BasicClient(serverName, "unknown");
     return session;
 }
コード例 #8
0
 public virtual void RegisterSessionTemplates(TemplateRegistry registry)
 {
     registry.RegisterAll(TEMPLATE_REGISTRY);
 }
コード例 #9
0
 public virtual MessageTemplate CreateTemplateFromMessage(Message templateDef, TemplateRegistry registry)
 {
     string name = templateDef.GetString("Name");
     Field[] fields = GroupConverter.ParseFieldInstructions(templateDef, registry, initialContext);
     return new MessageTemplate(name, fields);
 }
コード例 #10
0
 public override Session Connect(string senderName, Connection connection, TemplateRegistry inboundRegistry, TemplateRegistry outboundRegistry, MessageListener messageListener, SessionListener sessionListener)
 {
     var session = new Session(connection, this, TemplateRegistry_Fields.NULL, TemplateRegistry_Fields.NULL);
     session.MessageOutputStream.WriteMessage(CreateHelloMessage(senderName));
     try
     {
         System.Threading.Thread.Sleep(new TimeSpan((Int64) 10000 * 20));
     }
     catch (System.Threading.ThreadInterruptedException)
     {
     }
     var message = session.MessageInputStream.ReadMessage();
     string serverName = message.GetString(1);
     string vendorId = message.IsDefined(2)?message.GetString(2):"unknown";
     session.Client = new BasicClient(serverName, vendorId);
     return session;
 }