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); }
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); }
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)); }
public virtual void RegisterSessionTemplates(TemplateRegistry registry) { registry.RegisterAll(TEMPLATE_REGISTRY); }
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); }
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; }
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); }
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; }