jspurefix 5.10.1 → 5.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATDL_PLAN.md +109 -0
- package/WORKLOG.md +108 -13
- package/dist/dictionary/compiler/standard-snippet.js +2 -2
- package/dist/dictionary/compiler/standard-snippet.js.map +1 -1
- package/dist/jsfix-cmd.js +2 -2
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/runtime/session-container.js +11 -8
- package/dist/runtime/session-container.js.map +1 -1
- package/dist/runtime/session-launcher.d.ts +2 -0
- package/dist/runtime/session-launcher.js +10 -1
- package/dist/runtime/session-launcher.js.map +1 -1
- package/dist/transport/duplex/http-duplex.d.ts +1 -1
- package/dist/transport/duplex/http-duplex.js +2 -5
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/docs/acceptor.md +32 -0
- package/jsfix.test_client.txt +62 -62
- package/jsfix.test_server.txt +72 -72
- package/package.json +1 -3
- package/src/dictionary/compiler/standard-snippet.ts +2 -2
- package/src/jsfix-cmd.ts +2 -2
- package/src/runtime/session-container.ts +12 -4
- package/src/runtime/session-launcher.ts +29 -1
- package/src/transport/duplex/http-duplex.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-container.js","sourceRoot":"","sources":["../../src/runtime/session-container.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAyD;AACzD,kCAA2C;AAC3C,sCAAmG;AACnG,2CAAsC;AACtC,+CAA8C;AAE9C,0CAGyB;AACzB,4CAA8F;AAE9F,oFAA8E;AAC9E,oFAA8E;AAC9E,8CAA2D;AAC3D,8CAA2D;AAC3D,sCAAgE;AAChE,2CAAmF;AACnF,2CAA2D;AAU3D,MAAa,gBAAgB;IAQ3B,YAA6B,qBAAuD,IAAI;QAA3D,uBAAkB,GAAlB,kBAAkB,CAAyC;IACxF,CAAC;IAEM,KAAK;QACV,oBAAS,CAAC,KAAK,EAAE,CAAA;IACnB,CA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CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,gBAAgB,CAAC,QAAQ,CAAY,oBAAQ,CAAC,SAAS,EAAE;gBACvD,QAAQ,EAAE,2BAAoB;aAC/B,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAES,cAAc,CAAE,CAAe,EAAE,gBAAqC;QAC9E,gBAAgB,CAAC,QAAQ,CAAC,oBAAQ,CAAC,SAAS,EAAE;YAC5C,QAAQ,EAAE,CAAC,CAAC,SAAS;SACtB,CAAC,CAAA;QACF,gBAAgB,CAAC,QAAQ,CAAC,oBAAQ,CAAC,YAAY,EAAE;YAC/C,QAAQ,EAAE,CAAC,CAAC,YAAY;SACzB,CAAC,CAAA;IACJ,CAAC;IAEM,eAAe,CAAE,CAAe,EAAE,gBAAqC;QAC5E,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;YAC7C,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAA;QAC1C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;QAC/C,CAAC;QACD,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACrC,gBAAgB,CAAC,gBAAgB,CAAC,oBAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAA;QAC3D,gBAAgB,CAAC,gBAAgB,CAAC,oBAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,CAAA;IACxE,CAAC;CACF;AAnLD,4CAmLC","sourcesContent":["import { container, DependencyContainer } from 'tsyringe'\nimport { DefinitionFactory } from '../util'\nimport { IJsFixConfig, JsFixLoggerFactory, JsFixWinstonLogFactory, WinstonLogger } from '../config'\nimport { DITokens } from './di-tokens'\nimport { RuntimeFactory } from './make-config'\n\nimport {\n TcpAcceptorListener, RecoveringTcpInitiator,\n TcpInitiatorConnector, TcpInitiator\n} from '../transport/tcp'\nimport { HttpInitiator, HttpAcceptorListener, HttpJsonSampleAdapter } from '../transport/http'\nimport { ISessionMsgFactory, MsgTransmitter, ISessionDescription } from '../transport'\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\nimport { FixmlMsgTransmitter } from '../transport/fixml/fixml-msg-transmitter'\nimport { FixmlSessionMsgFactory } from '../transport/fixml'\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\nimport { ElasticBuffer, MsgEncoder, MsgParser } from '../buffer'\nimport { AsciiParser, AsciiParserState, AsciiSegmentParser } from '../buffer/ascii'\nimport { FixmlEncoder, FiXmlParser } from '../buffer/fixml'\nimport { FixEntity } from '../transport/fix-entity'\nimport { IHttpAdapter } from '../transport/http/http-adapter'\n\n/**\n * Supplies the session message factory for a description. Return null to accept the\n * stock factory for the protocol.\n */\nexport type SessionMsgFactoryProvider = (description: ISessionDescription) => ISessionMsgFactory | null\n\nexport class SessionContainer {\n /**\n * @param msgFactoryProvider an application that needs its own session messages -\n * typically a Logon carrying tags the standard message does not - can pass one\n * here rather than subclassing to override makeSessionFactory:\n *\n * new SessionContainer(d => new MyFactory(d))\n */\n constructor (public readonly msgFactoryProvider: SessionMsgFactoryProvider | null = null) {\n }\n\n public reset (): void {\n container.reset()\n }\n\n public registerGlobal (loggerFactory?: JsFixLoggerFactory): void\n public registerGlobal (level: string): void\n public registerGlobal (levelOrLoggerFactory: string | JsFixLoggerFactory = 'info'): void {\n container.registerInstance(DefinitionFactory, new DefinitionFactory())\n let lf: JsFixLoggerFactory\n if (typeof levelOrLoggerFactory === 'string') {\n lf = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions(levelOrLoggerFactory))\n } else {\n lf = levelOrLoggerFactory\n }\n container.registerInstance(DITokens.JsFixLoggerFactory, lf)\n container.register<RuntimeFactory>(RuntimeFactory, {\n useClass: RuntimeFactory\n })\n container.register<ElasticBuffer>(DITokens.ElasticBuffer, {\n useClass: ElasticBuffer\n })\n }\n\n protected makeSessionFactory (description: ISessionDescription): ISessionMsgFactory {\n const supplied = this.msgFactoryProvider?.(description)\n if (supplied) {\n return supplied\n }\n const fixml = !this.isAscii(description)\n return fixml\n ? new FixmlSessionMsgFactory(description)\n : new AsciiSessionMsgFactory(description)\n }\n\n public newChild (description: ISessionDescription): DependencyContainer {\n const sessionContainer = container.createChildContainer()\n const sf = this.makeSessionFactory(description)\n sessionContainer.registerInstance(DITokens.ISessionDescription, description)\n sessionContainer.registerInstance(DITokens.ISessionMsgFactory, sf)\n return sessionContainer\n }\n\n public async makeSystem (description: ISessionDescription): Promise<DependencyContainer> {\n return await new Promise<DependencyContainer>((resolve, reject) => {\n const sessionContainer = this.newChild(description)\n const factory = sessionContainer.resolve<RuntimeFactory>(RuntimeFactory)\n factory.makeConfig().then((c: IJsFixConfig) => {\n this.registerSession(c, sessionContainer)\n resolve(sessionContainer)\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n public isAscii (description: ISessionDescription): boolean {\n return description.application?.protocol === 'ascii'\n }\n\n public isInitiator (description: ISessionDescription): boolean {\n return description.application?.type === 'initiator'\n }\n\n public asAscii (description: ISessionDescription, sessionContainer: DependencyContainer): void {\n sessionContainer.register<MsgTransmitter>(DITokens.MsgTransmitter, {\n useClass: AsciiMsgTransmitter\n })\n sessionContainer.register<MsgParser>(DITokens.MsgParser, {\n useClass: AsciiParser\n })\n const parseSize = 160 * 1024\n const sendSize = 10 * 1024\n\n sessionContainer.register(DITokens.maxMessageLen, {\n useValue: parseSize\n })\n sessionContainer.register<AsciiSegmentParser>(AsciiSegmentParser, {\n useClass: AsciiSegmentParser\n })\n sessionContainer.register<AsciiParserState>(AsciiParserState, {\n useClass: AsciiParserState\n })\n\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.TransmitBuffer, new ElasticBuffer(sendSize))\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.ParseBuffer, new ElasticBuffer(parseSize))\n\n if (this.isInitiator(description)) {\n sessionContainer.register<TcpInitiator>(TcpInitiator, {\n useClass: TcpInitiator\n })\n sessionContainer.register<RecoveringTcpInitiator>(RecoveringTcpInitiator, {\n useClass: RecoveringTcpInitiator\n })\n sessionContainer.register<TcpInitiatorConnector>(TcpInitiatorConnector, {\n useClass: TcpInitiatorConnector\n })\n if (description.application?.resilient) {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: RecoveringTcpInitiator\n })\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: TcpInitiatorConnector\n })\n }\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: TcpAcceptorListener\n })\n }\n }\n\n public asFixml (description: ISessionDescription, sessionContainer: DependencyContainer): void {\n sessionContainer.register<MsgTransmitter>(DITokens.MsgTransmitter, {\n useClass: FixmlMsgTransmitter\n })\n const sendSize = 10 * 1024\n\n sessionContainer.register<MsgParser>(DITokens.MsgParser, {\n useClass: FiXmlParser\n })\n sessionContainer.register(DITokens.maxMessageLocations, {\n useValue: sendSize\n })\n sessionContainer.register<MsgEncoder>(DITokens.MsgEncoder, {\n useClass: FixmlEncoder\n })\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.TransmitBuffer, new ElasticBuffer(sendSize))\n sessionContainer.register<HttpAcceptorListener>(HttpAcceptorListener, {\n useClass: HttpAcceptorListener\n })\n sessionContainer.register<HttpInitiator>(HttpInitiator, {\n useClass: HttpInitiator\n })\n if (this.isInitiator(description)) {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: HttpInitiator\n })\n sessionContainer.register<IHttpAdapter>(DITokens.IHttpAdapter, {\n useClass: HttpJsonSampleAdapter\n })\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: HttpAcceptorListener\n })\n }\n }\n\n protected asciiConstants (c: IJsFixConfig, sessionContainer: DependencyContainer): void {\n sessionContainer.register(DITokens.delimiter, {\n useValue: c.delimiter\n })\n sessionContainer.register(DITokens.logDelimiter, {\n useValue: c.logDelimiter\n })\n }\n\n public registerSession (c: IJsFixConfig, sessionContainer: DependencyContainer): void {\n if (this.isAscii(c.description)) {\n this.asAscii(c.description, sessionContainer)\n this.asciiConstants(c, sessionContainer)\n } else {\n this.asFixml(c.description, sessionContainer)\n }\n c.sessionContainer = sessionContainer\n sessionContainer.registerInstance(DITokens.IJsFixConfig, c)\n sessionContainer.registerInstance(DITokens.Definitions, c.definitions)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"session-container.js","sourceRoot":"","sources":["../../src/runtime/session-container.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAyD;AACzD,kCAA2C;AAC3C,sCAAmG;AACnG,2CAAsC;AACtC,+CAA8C;AAE9C,0CAGyB;AAEzB,oFAA8E;AAC9E,oFAA8E;AAC9E,8CAA2D;AAC3D,8CAA2D;AAC3D,sCAAgE;AAChE,2CAAmF;AACnF,2CAA2D;AAQ3D,SAAS,aAAa;IACpB,OAAO,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACrC,CAAC;AAQD,MAAa,gBAAgB;IAQ3B,YAA6B,qBAAuD,IAAI;QAA3D,uBAAkB,GAAlB,kBAAkB,CAAyC;IACxF,CAAC;IAEM,KAAK;QACV,oBAAS,CAAC,KAAK,EAAE,CAAA;IACnB,CAAC;IAIM,cAAc,CAAE,uBAAoD,MAAM;QAC/E,oBAAS,CAAC,gBAAgB,CAAC,wBAAiB,EAAE,IAAI,wBAAiB,EAAE,CAAC,CAAA;QACtE,IAAI,EAAsB,CAAA;QAC1B,IAAI,OAAO,oBAAoB,KAAK,QAAQ,EAAE,CAAC;YAC7C,EAAE,GAAG,IAAI,+BAAsB,CAAC,sBAAa,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAA;QACrF,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,oBAAoB,CAAA;QAC3B,CAAC;QACD,oBAAS,CAAC,gBAAgB,C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tB,CAAC,CAAA;QACF,gBAAgB,CAAC,QAAQ,CAAC,oBAAQ,CAAC,YAAY,EAAE;YAC/C,QAAQ,EAAE,CAAC,CAAC,YAAY;SACzB,CAAC,CAAA;IACJ,CAAC;IAEM,eAAe,CAAE,CAAe,EAAE,gBAAqC;QAC5E,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;YAC7C,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAA;QAC1C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;QAC/C,CAAC;QACD,CAAC,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACrC,gBAAgB,CAAC,gBAAgB,CAAC,oBAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAA;QAC3D,gBAAgB,CAAC,gBAAgB,CAAC,oBAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,CAAA;IACxE,CAAC;CACF;AApLD,4CAoLC","sourcesContent":["import { container, DependencyContainer } from 'tsyringe'\nimport { DefinitionFactory } from '../util'\nimport { IJsFixConfig, JsFixLoggerFactory, JsFixWinstonLogFactory, WinstonLogger } from '../config'\nimport { DITokens } from './di-tokens'\nimport { RuntimeFactory } from './make-config'\n\nimport {\n TcpAcceptorListener, RecoveringTcpInitiator,\n TcpInitiatorConnector, TcpInitiator\n} from '../transport/tcp'\nimport { ISessionMsgFactory, MsgTransmitter, ISessionDescription } from '../transport'\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\nimport { FixmlMsgTransmitter } from '../transport/fixml/fixml-msg-transmitter'\nimport { FixmlSessionMsgFactory } from '../transport/fixml'\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\nimport { ElasticBuffer, MsgEncoder, MsgParser } from '../buffer'\nimport { AsciiParser, AsciiParserState, AsciiSegmentParser } from '../buffer/ascii'\nimport { FixmlEncoder, FiXmlParser } from '../buffer/fixml'\nimport { FixEntity } from '../transport/fix-entity'\nimport type { IHttpAdapter } from '../transport/http/http-adapter'\n\n/**\n * The http transport pulls in express. Only a fixml session registers it, so resolve\n * it on demand - an ascii application should neither load that tree nor inherit it.\n */\nfunction httpTransport (): typeof import('../transport/http') {\n return require('../transport/http')\n}\n\n/**\n * Supplies the session message factory for a description. Return null to accept the\n * stock factory for the protocol.\n */\nexport type SessionMsgFactoryProvider = (description: ISessionDescription) => ISessionMsgFactory | null\n\nexport class SessionContainer {\n /**\n * @param msgFactoryProvider an application that needs its own session messages -\n * typically a Logon carrying tags the standard message does not - can pass one\n * here rather than subclassing to override makeSessionFactory:\n *\n * new SessionContainer(d => new MyFactory(d))\n */\n constructor (public readonly msgFactoryProvider: SessionMsgFactoryProvider | null = null) {\n }\n\n public reset (): void {\n container.reset()\n }\n\n public registerGlobal (loggerFactory?: JsFixLoggerFactory): void\n public registerGlobal (level: string): void\n public registerGlobal (levelOrLoggerFactory: string | JsFixLoggerFactory = 'info'): void {\n container.registerInstance(DefinitionFactory, new DefinitionFactory())\n let lf: JsFixLoggerFactory\n if (typeof levelOrLoggerFactory === 'string') {\n lf = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions(levelOrLoggerFactory))\n } else {\n lf = levelOrLoggerFactory\n }\n container.registerInstance(DITokens.JsFixLoggerFactory, lf)\n container.register<RuntimeFactory>(RuntimeFactory, {\n useClass: RuntimeFactory\n })\n container.register<ElasticBuffer>(DITokens.ElasticBuffer, {\n useClass: ElasticBuffer\n })\n }\n\n protected makeSessionFactory (description: ISessionDescription): ISessionMsgFactory {\n const supplied = this.msgFactoryProvider?.(description)\n if (supplied) {\n return supplied\n }\n const fixml = !this.isAscii(description)\n return fixml\n ? new FixmlSessionMsgFactory(description)\n : new AsciiSessionMsgFactory(description)\n }\n\n public newChild (description: ISessionDescription): DependencyContainer {\n const sessionContainer = container.createChildContainer()\n const sf = this.makeSessionFactory(description)\n sessionContainer.registerInstance(DITokens.ISessionDescription, description)\n sessionContainer.registerInstance(DITokens.ISessionMsgFactory, sf)\n return sessionContainer\n }\n\n public async makeSystem (description: ISessionDescription): Promise<DependencyContainer> {\n return await new Promise<DependencyContainer>((resolve, reject) => {\n const sessionContainer = this.newChild(description)\n const factory = sessionContainer.resolve<RuntimeFactory>(RuntimeFactory)\n factory.makeConfig().then((c: IJsFixConfig) => {\n this.registerSession(c, sessionContainer)\n resolve(sessionContainer)\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n public isAscii (description: ISessionDescription): boolean {\n return description.application?.protocol === 'ascii'\n }\n\n public isInitiator (description: ISessionDescription): boolean {\n return description.application?.type === 'initiator'\n }\n\n public asAscii (description: ISessionDescription, sessionContainer: DependencyContainer): void {\n sessionContainer.register<MsgTransmitter>(DITokens.MsgTransmitter, {\n useClass: AsciiMsgTransmitter\n })\n sessionContainer.register<MsgParser>(DITokens.MsgParser, {\n useClass: AsciiParser\n })\n const parseSize = 160 * 1024\n const sendSize = 10 * 1024\n\n sessionContainer.register(DITokens.maxMessageLen, {\n useValue: parseSize\n })\n sessionContainer.register<AsciiSegmentParser>(AsciiSegmentParser, {\n useClass: AsciiSegmentParser\n })\n sessionContainer.register<AsciiParserState>(AsciiParserState, {\n useClass: AsciiParserState\n })\n\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.TransmitBuffer, new ElasticBuffer(sendSize))\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.ParseBuffer, new ElasticBuffer(parseSize))\n\n if (this.isInitiator(description)) {\n sessionContainer.register<TcpInitiator>(TcpInitiator, {\n useClass: TcpInitiator\n })\n sessionContainer.register<RecoveringTcpInitiator>(RecoveringTcpInitiator, {\n useClass: RecoveringTcpInitiator\n })\n sessionContainer.register<TcpInitiatorConnector>(TcpInitiatorConnector, {\n useClass: TcpInitiatorConnector\n })\n if (description.application?.resilient) {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: RecoveringTcpInitiator\n })\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: TcpInitiatorConnector\n })\n }\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: TcpAcceptorListener\n })\n }\n }\n\n public asFixml (description: ISessionDescription, sessionContainer: DependencyContainer): void {\n sessionContainer.register<MsgTransmitter>(DITokens.MsgTransmitter, {\n useClass: FixmlMsgTransmitter\n })\n const sendSize = 10 * 1024\n\n sessionContainer.register<MsgParser>(DITokens.MsgParser, {\n useClass: FiXmlParser\n })\n sessionContainer.register(DITokens.maxMessageLocations, {\n useValue: sendSize\n })\n sessionContainer.register<MsgEncoder>(DITokens.MsgEncoder, {\n useClass: FixmlEncoder\n })\n sessionContainer.registerInstance<ElasticBuffer>(DITokens.TransmitBuffer, new ElasticBuffer(sendSize))\n const { HttpInitiator, HttpAcceptorListener, HttpJsonSampleAdapter } = httpTransport()\n sessionContainer.register(HttpAcceptorListener, {\n useClass: HttpAcceptorListener\n })\n sessionContainer.register(HttpInitiator, {\n useClass: HttpInitiator\n })\n if (this.isInitiator(description)) {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: HttpInitiator\n })\n sessionContainer.register<IHttpAdapter>(DITokens.IHttpAdapter, {\n useClass: HttpJsonSampleAdapter\n })\n } else {\n sessionContainer.register<FixEntity>(DITokens.FixEntity, {\n useClass: HttpAcceptorListener\n })\n }\n }\n\n protected asciiConstants (c: IJsFixConfig, sessionContainer: DependencyContainer): void {\n sessionContainer.register(DITokens.delimiter, {\n useValue: c.delimiter\n })\n sessionContainer.register(DITokens.logDelimiter, {\n useValue: c.logDelimiter\n })\n }\n\n public registerSession (c: IJsFixConfig, sessionContainer: DependencyContainer): void {\n if (this.isAscii(c.description)) {\n this.asAscii(c.description, sessionContainer)\n this.asciiConstants(c, sessionContainer)\n } else {\n this.asFixml(c.description, sessionContainer)\n }\n c.sessionContainer = sessionContainer\n sessionContainer.registerInstance(DITokens.IJsFixConfig, c)\n sessionContainer.registerInstance(DITokens.Definitions, c.definitions)\n }\n}\n"]}
|
|
@@ -14,9 +14,11 @@ export declare abstract class SessionLauncher {
|
|
|
14
14
|
protected makeSessionMsgFactory(_description: ISessionDescription): ISessionMsgFactory | null;
|
|
15
15
|
private empty;
|
|
16
16
|
private acceptorEntity;
|
|
17
|
+
private stopRequested;
|
|
17
18
|
protected getAcceptor(sessionContainer: DependencyContainer): Promise<any>;
|
|
18
19
|
protected getInitiator(sessionContainer: DependencyContainer): Promise<any>;
|
|
19
20
|
protected makeFactory(config: IJsFixConfig): EngineFactory | null;
|
|
21
|
+
stop(): void;
|
|
20
22
|
run(): Promise<boolean>;
|
|
21
23
|
exec(): void;
|
|
22
24
|
isAscii(description: ISessionDescription): boolean;
|
|
@@ -54,6 +54,7 @@ class SessionLauncher {
|
|
|
54
54
|
this.root = '../../';
|
|
55
55
|
this.sessionContainer = new session_container_1.SessionContainer((d) => this.makeSessionMsgFactory(d));
|
|
56
56
|
this.acceptorEntity = null;
|
|
57
|
+
this.stopRequested = false;
|
|
57
58
|
this.logger = this.loggerFactory.logger('launcher');
|
|
58
59
|
this.initiatorConfig = initiatorConfig ? this.loadConfig(initiatorConfig) : null;
|
|
59
60
|
this.acceptorConfig = acceptorConfig ? this.loadConfig(acceptorConfig) : null;
|
|
@@ -81,6 +82,10 @@ class SessionLauncher {
|
|
|
81
82
|
if (sessionContainer.isRegistered(di_tokens_1.DITokens.FixEntity)) {
|
|
82
83
|
const entity = sessionContainer.resolve(di_tokens_1.DITokens.FixEntity);
|
|
83
84
|
this.acceptorEntity = entity;
|
|
85
|
+
if (this.stopRequested) {
|
|
86
|
+
this.logger.info('stop requested before the acceptor started - not listening');
|
|
87
|
+
return this.empty();
|
|
88
|
+
}
|
|
84
89
|
return entity.start();
|
|
85
90
|
}
|
|
86
91
|
else {
|
|
@@ -102,6 +107,10 @@ class SessionLauncher {
|
|
|
102
107
|
makeFactory(config) {
|
|
103
108
|
return null;
|
|
104
109
|
}
|
|
110
|
+
stop() {
|
|
111
|
+
this.stopRequested = true;
|
|
112
|
+
this.stopAcceptor();
|
|
113
|
+
}
|
|
105
114
|
run() {
|
|
106
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
116
|
return yield new Promise((resolve, reject) => {
|
|
@@ -195,7 +204,7 @@ class SessionLauncher {
|
|
|
195
204
|
if (this.acceptorConfig && this.initiatorConfig) {
|
|
196
205
|
yield client;
|
|
197
206
|
this.logger.info('client finished, stopping acceptor');
|
|
198
|
-
this.
|
|
207
|
+
this.stop();
|
|
199
208
|
return true;
|
|
200
209
|
}
|
|
201
210
|
return yield Promise.all([server, client]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-launcher.js","sourceRoot":"","sources":["../../src/runtime/session-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAC5B,sCAAiH;AAIjH,2DAAsD;AACtD,2CAAsC;AAEtC,MAAM,oBAAoB,GAAG,IAAI,+BAAsB,CAAC,sBAAa,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;AAE7F,MAAsB,eAAe;IAMnC,YACE,kBAAuD,IAAI,EAC3D,iBAAsD,IAAI,EACzC,gBAAoC,oBAAoB;QAAxD,kBAAa,GAAb,aAAa,CAA2C;QARpE,SAAI,GAAW,QAAQ,CAAA;QAiBpB,qBAAgB,GACxB,IAAI,oCAAgB,CAAC,CAAC,CAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAA;QA6BzE,mBAAc,GAAqB,IAAI,CAAA;QArC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QACnD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC,CA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YAAY,EAAE,CAAA;gBACnB,OAAO,IAAI,CAAA;YACb,CAAC;YACD,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QAC5C,CAAC;KAAA;IAEO,YAAY;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,cAAqB,CAAA;QACzC,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAChD,MAAM,CAAC,IAAI,EAAE,CAAA;QACf,CAAC;IACH,CAAC;IAEO,UAAU,CAAE,MAAoC;QACtD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;QAC9C,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAvMD,0CAuMC","sourcesContent":["import * as path from 'path'\nimport { IJsFixConfig, IJsFixLogger, JsFixLoggerFactory, JsFixWinstonLogFactory, WinstonLogger } from '../config'\nimport { FixEntity, FixSession, ISessionDescription, ISessionMsgFactory } from '../transport'\nimport { DependencyContainer } from 'tsyringe'\nimport { EngineFactory } from './engine-factory'\nimport { SessionContainer } from './session-container'\nimport { DITokens } from './di-tokens'\n\nconst defaultLoggerFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))\n\nexport abstract class SessionLauncher {\n public root: string = '../../'\n protected readonly logger: IJsFixLogger\n public readonly initiatorConfig: ISessionDescription | null\n public readonly acceptorConfig: ISessionDescription | null\n\n protected constructor (\n initiatorConfig: string | ISessionDescription | null = null,\n acceptorConfig: string | ISessionDescription | null = null,\n private readonly loggerFactory: JsFixLoggerFactory = defaultLoggerFactory\n ) {\n this.logger = this.loggerFactory.logger('launcher')\n this.initiatorConfig = initiatorConfig ? this.loadConfig(initiatorConfig) : null\n this.acceptorConfig = acceptorConfig ? this.loadConfig(acceptorConfig) : null\n }\n\n // the arrow defers to makeSessionMsgFactory at resolve time, so a subclass need\n // only override that one method - no SessionContainer subclass required\n protected sessionContainer: SessionContainer =\n new SessionContainer((d: ISessionDescription) => this.makeSessionMsgFactory(d))\n\n /**\n * Override to supply this application's own session message factory - the place to\n * put a Logon carrying tags the standard message does not, or a header a\n * counterparty stamps differently. Return null (the default) for the stock\n * factory.\n *\n * For a Logon that only needs extra fields, prefer the \"Logon\" block in the session\n * description - it needs no code at all. Reach for a factory when the values are\n * computed at run time (a signature, a nonce, a token fetched at start up).\n */\n protected makeSessionMsgFactory (_description: ISessionDescription): ISessionMsgFactory | null {\n return null\n }\n\n private async empty (): Promise<any> {\n return await new Promise((resolve, reject) => {\n try {\n setImmediate(() => {\n this.logger.info('resolving an empty promise')\n resolve(null)\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n private acceptorEntity: FixEntity | null = null\n\n protected async getAcceptor (sessionContainer: DependencyContainer): Promise<any> {\n if (sessionContainer.isRegistered<FixEntity>(DITokens.FixEntity)) {\n const entity = sessionContainer.resolve<FixEntity>(DITokens.FixEntity)\n this.acceptorEntity = entity\n return entity.start()\n } else {\n return this.empty()\n }\n }\n\n protected async getInitiator (sessionContainer: DependencyContainer): Promise<any> {\n if (sessionContainer.isRegistered<FixEntity>(DITokens.FixEntity)) {\n const entity = sessionContainer.resolve<FixEntity>(DITokens.FixEntity)\n return entity.start()\n } else {\n return this.empty()\n }\n }\n\n /**\n * provide a factory which will be invoked with a config where an instance of the application\n * should be constructed and returned.\n * @param config to be provided to the constucted application representing this session\n * @protected\n */\n protected makeFactory (config: IJsFixConfig): EngineFactory | null {\n return null\n }\n\n public async run (): Promise<boolean> {\n return await new Promise<any>((resolve, reject) => {\n const logger = this.logger\n logger.info('launching ..')\n this.setup().then(() => {\n logger.info('.. done')\n resolve(true)\n }).catch((e: Error) => {\n logger.error(e)\n reject(e)\n })\n })\n }\n\n public exec (): void {\n this.run().then(() => {\n console.log('finished.')\n }).catch(e => {\n console.error(e)\n })\n }\n\n /**\n * is this session config representing an ascii based session\n * @param description config to be tested.\n */\n public isAscii (description: ISessionDescription): boolean {\n return this.sessionContainer.isAscii(description)\n }\n\n /**\n * is this session config representing an initiator based session\n * @param description config to be tested.\n */\n public isInitiator (description: ISessionDescription): boolean {\n return this.sessionContainer.isInitiator(description)\n }\n\n protected registerApplication (_: DependencyContainer): void {\n this.logger.info('bypass register via DI')\n }\n\n private async makeSystem (description: ISessionDescription): Promise<DependencyContainer> {\n const name = description.application?.name ?? 'na'\n const protocol = description.application?.protocol ?? 'ascii'\n this.logger.info(`creating app ${name} [protocol ${protocol}]`)\n return await this.sessionContainer.makeSystem(description)\n }\n\n private register (container: DependencyContainer): void {\n const config = container.resolve<IJsFixConfig>(DITokens.IJsFixConfig)\n const factory = this.makeFactory(config)\n if (!factory) {\n this.registerApplication(container)\n } else {\n if (factory.makeSession) {\n // resolve the config from the container doing the resolving, not the one\n // captured here. An acceptor resolves each session from a per-connection\n // child scope which re-registers IJsFixConfig, so this is how an application\n // receives that session's own description, store and message factory.\n container.register<FixSession>(DITokens.FixSession, {\n useFactory: (c) => factory.makeSession(c.resolve<IJsFixConfig>(DITokens.IJsFixConfig))\n })\n }\n }\n }\n\n private async makeClient (): Promise<any> {\n if (!this.initiatorConfig) return\n const sessionContainer = await this.makeSystem(this.initiatorConfig)\n this.register(sessionContainer)\n this.logger.info('create initiator')\n return await this.getInitiator(sessionContainer)\n }\n\n private async makeServer (): Promise<any> {\n if (!this.acceptorConfig) return\n const sessionContainer = await this.makeSystem(this.acceptorConfig)\n this.register(sessionContainer)\n this.logger.info('create acceptor')\n return await this.getAcceptor(sessionContainer)\n }\n\n async serverOrEmpty (): Promise<any> {\n return this.acceptorConfig ? this.makeServer() : this.empty()\n }\n\n async clientOrEmpty (): Promise<any> {\n return this.initiatorConfig ? this.makeClient() : this.empty()\n }\n\n private async setup (): Promise<any> {\n this.sessionContainer.registerGlobal(this.loggerFactory)\n const server = this.serverOrEmpty()\n const client = this.clientOrEmpty()\n this.logger.info('launching ....')\n if (this.acceptorConfig && this.initiatorConfig) {\n // Both mode: client drives the lifecycle. When client finishes,\n // stop the acceptor so the process can exit cleanly.\n await client\n this.logger.info('client finished, stopping acceptor')\n this.stopAcceptor()\n return true\n }\n return await Promise.all([server, client])\n }\n\n private stopAcceptor (): void {\n const entity = this.acceptorEntity as any\n if (entity && typeof entity.stop === 'function') {\n entity.stop()\n }\n }\n\n private loadConfig (config: string | ISessionDescription): ISessionDescription {\n if (typeof config === 'string') {\n return require(path.join(this.root, config))\n }\n return config\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"session-launcher.js","sourceRoot":"","sources":["../../src/runtime/session-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAC5B,sCAAiH;AAIjH,2DAAsD;AACtD,2CAAsC;AAEtC,MAAM,oBAAoB,GAAG,IAAI,+BAAsB,CAAC,sBAAa,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;AAE7F,MAAsB,eAAe;IAMnC,YACE,kBAAuD,IAAI,EAC3D,iBAAsD,IAAI,EACzC,gBAAoC,oBAAoB;QAAxD,kBAAa,GAAb,aAAa,CAA2C;QARpE,SAAI,GAAW,QAAQ,CAAA;QAiBpB,qBAAgB,GACxB,IAAI,oCAAgB,CAAC,CAAC,CAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAA;QA6BzE,mBAAc,GAAqB,IAAI,CAAA;QACvC,kBAAa,GAAY,KAAK,CAAA;QAtCpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QACnD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAChF,IAAI,CA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CAAA;YAClC,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBAGhD,MAAM,MAAM,CAAA;gBACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;gBACtD,IAAI,CAAC,IAAI,EAAE,CAAA;gBACX,OAAO,IAAI,CAAA;YACb,CAAC;YACD,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QAC5C,CAAC;KAAA;IAEO,YAAY;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,cAAqB,CAAA;QACzC,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAChD,MAAM,CAAC,IAAI,EAAE,CAAA;QACf,CAAC;IACH,CAAC;IAEO,UAAU,CAAE,MAAoC;QACtD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;QAC9C,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAnOD,0CAmOC","sourcesContent":["import * as path from 'path'\nimport { IJsFixConfig, IJsFixLogger, JsFixLoggerFactory, JsFixWinstonLogFactory, WinstonLogger } from '../config'\nimport { FixEntity, FixSession, ISessionDescription, ISessionMsgFactory } from '../transport'\nimport { DependencyContainer } from 'tsyringe'\nimport { EngineFactory } from './engine-factory'\nimport { SessionContainer } from './session-container'\nimport { DITokens } from './di-tokens'\n\nconst defaultLoggerFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))\n\nexport abstract class SessionLauncher {\n public root: string = '../../'\n protected readonly logger: IJsFixLogger\n public readonly initiatorConfig: ISessionDescription | null\n public readonly acceptorConfig: ISessionDescription | null\n\n protected constructor (\n initiatorConfig: string | ISessionDescription | null = null,\n acceptorConfig: string | ISessionDescription | null = null,\n private readonly loggerFactory: JsFixLoggerFactory = defaultLoggerFactory\n ) {\n this.logger = this.loggerFactory.logger('launcher')\n this.initiatorConfig = initiatorConfig ? this.loadConfig(initiatorConfig) : null\n this.acceptorConfig = acceptorConfig ? this.loadConfig(acceptorConfig) : null\n }\n\n // the arrow defers to makeSessionMsgFactory at resolve time, so a subclass need\n // only override that one method - no SessionContainer subclass required\n protected sessionContainer: SessionContainer =\n new SessionContainer((d: ISessionDescription) => this.makeSessionMsgFactory(d))\n\n /**\n * Override to supply this application's own session message factory - the place to\n * put a Logon carrying tags the standard message does not, or a header a\n * counterparty stamps differently. Return null (the default) for the stock\n * factory.\n *\n * For a Logon that only needs extra fields, prefer the \"Logon\" block in the session\n * description - it needs no code at all. Reach for a factory when the values are\n * computed at run time (a signature, a nonce, a token fetched at start up).\n */\n protected makeSessionMsgFactory (_description: ISessionDescription): ISessionMsgFactory | null {\n return null\n }\n\n private async empty (): Promise<any> {\n return await new Promise((resolve, reject) => {\n try {\n setImmediate(() => {\n this.logger.info('resolving an empty promise')\n resolve(null)\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n private acceptorEntity: FixEntity | null = null\n private stopRequested: boolean = false\n\n protected async getAcceptor (sessionContainer: DependencyContainer): Promise<any> {\n if (sessionContainer.isRegistered<FixEntity>(DITokens.FixEntity)) {\n const entity = sessionContainer.resolve<FixEntity>(DITokens.FixEntity)\n this.acceptorEntity = entity\n // a stop can arrive while the container is still being built - the listener has\n // no existence yet to close, so honour the request by never opening it\n if (this.stopRequested) {\n this.logger.info('stop requested before the acceptor started - not listening')\n return this.empty()\n }\n return entity.start()\n } else {\n return this.empty()\n }\n }\n\n protected async getInitiator (sessionContainer: DependencyContainer): Promise<any> {\n if (sessionContainer.isRegistered<FixEntity>(DITokens.FixEntity)) {\n const entity = sessionContainer.resolve<FixEntity>(DITokens.FixEntity)\n return entity.start()\n } else {\n return this.empty()\n }\n }\n\n /**\n * provide a factory which will be invoked with a config where an instance of the application\n * should be constructed and returned.\n * @param config to be provided to the constucted application representing this session\n * @protected\n */\n protected makeFactory (config: IJsFixConfig): EngineFactory | null {\n return null\n }\n\n /**\n * Stop what this launcher started - in practice, close the acceptor's listener.\n *\n * An acceptor is meant to outlive any one counterparty, so nothing closes its\n * listener on its own. That is right for a venue and wrong for an application\n * which knows it is finished: the listening socket alone keeps node alive, long\n * after every session has logged out and every transport has been harvested.\n *\n * Until now the only caller was the both-roles branch of setup() below, which an\n * application cannot reach once it gives the acceptor a launcher of its own - the\n * usual arrangement as soon as more than one client is involved. There was then\n * no way to shut a listener down short of killing the process.\n *\n * Safe before start (the request is remembered and the listener never opens), and\n * safe to call twice. run() resolves once the listener has closed.\n */\n public stop (): void {\n this.stopRequested = true\n this.stopAcceptor()\n }\n\n public async run (): Promise<boolean> {\n return await new Promise<any>((resolve, reject) => {\n const logger = this.logger\n logger.info('launching ..')\n this.setup().then(() => {\n logger.info('.. done')\n resolve(true)\n }).catch((e: Error) => {\n logger.error(e)\n reject(e)\n })\n })\n }\n\n public exec (): void {\n this.run().then(() => {\n console.log('finished.')\n }).catch(e => {\n console.error(e)\n })\n }\n\n /**\n * is this session config representing an ascii based session\n * @param description config to be tested.\n */\n public isAscii (description: ISessionDescription): boolean {\n return this.sessionContainer.isAscii(description)\n }\n\n /**\n * is this session config representing an initiator based session\n * @param description config to be tested.\n */\n public isInitiator (description: ISessionDescription): boolean {\n return this.sessionContainer.isInitiator(description)\n }\n\n protected registerApplication (_: DependencyContainer): void {\n this.logger.info('bypass register via DI')\n }\n\n private async makeSystem (description: ISessionDescription): Promise<DependencyContainer> {\n const name = description.application?.name ?? 'na'\n const protocol = description.application?.protocol ?? 'ascii'\n this.logger.info(`creating app ${name} [protocol ${protocol}]`)\n return await this.sessionContainer.makeSystem(description)\n }\n\n private register (container: DependencyContainer): void {\n const config = container.resolve<IJsFixConfig>(DITokens.IJsFixConfig)\n const factory = this.makeFactory(config)\n if (!factory) {\n this.registerApplication(container)\n } else {\n if (factory.makeSession) {\n // resolve the config from the container doing the resolving, not the one\n // captured here. An acceptor resolves each session from a per-connection\n // child scope which re-registers IJsFixConfig, so this is how an application\n // receives that session's own description, store and message factory.\n container.register<FixSession>(DITokens.FixSession, {\n useFactory: (c) => factory.makeSession(c.resolve<IJsFixConfig>(DITokens.IJsFixConfig))\n })\n }\n }\n }\n\n private async makeClient (): Promise<any> {\n if (!this.initiatorConfig) return\n const sessionContainer = await this.makeSystem(this.initiatorConfig)\n this.register(sessionContainer)\n this.logger.info('create initiator')\n return await this.getInitiator(sessionContainer)\n }\n\n private async makeServer (): Promise<any> {\n if (!this.acceptorConfig) return\n const sessionContainer = await this.makeSystem(this.acceptorConfig)\n this.register(sessionContainer)\n this.logger.info('create acceptor')\n return await this.getAcceptor(sessionContainer)\n }\n\n async serverOrEmpty (): Promise<any> {\n return this.acceptorConfig ? this.makeServer() : this.empty()\n }\n\n async clientOrEmpty (): Promise<any> {\n return this.initiatorConfig ? this.makeClient() : this.empty()\n }\n\n private async setup (): Promise<any> {\n this.sessionContainer.registerGlobal(this.loggerFactory)\n const server = this.serverOrEmpty()\n const client = this.clientOrEmpty()\n this.logger.info('launching ....')\n if (this.acceptorConfig && this.initiatorConfig) {\n // Both mode: client drives the lifecycle. When client finishes,\n // stop the acceptor so the process can exit cleanly.\n await client\n this.logger.info('client finished, stopping acceptor')\n this.stop()\n return true\n }\n return await Promise.all([server, client])\n }\n\n private stopAcceptor (): void {\n const entity = this.acceptorEntity as any\n if (entity && typeof entity.stop === 'function') {\n entity.stop()\n }\n }\n\n private loadConfig (config: string | ISessionDescription): ISessionDescription {\n if (typeof config === 'string') {\n return require(path.join(this.root, config))\n }\n return config\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FixDuplex } from './fix-duplex';
|
|
2
|
-
import { IHttpAdapter } from '../http/http-adapter';
|
|
2
|
+
import type { IHttpAdapter } from '../http/http-adapter';
|
|
3
3
|
export declare class HttpDuplex extends FixDuplex {
|
|
4
4
|
readonly adapter: IHttpAdapter;
|
|
5
5
|
constructor(adapter: IHttpAdapter);
|
|
@@ -8,13 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.HttpDuplex = void 0;
|
|
16
13
|
const fix_duplex_1 = require("./fix-duplex");
|
|
17
|
-
const axios_1 = __importDefault(require("axios"));
|
|
18
14
|
class HttpDuplex extends fix_duplex_1.FixDuplex {
|
|
19
15
|
constructor(adapter) {
|
|
20
16
|
super();
|
|
@@ -39,7 +35,8 @@ class HttpDuplex extends fix_duplex_1.FixDuplex {
|
|
|
39
35
|
const adapter = this.adapter;
|
|
40
36
|
const options = adapter.getOptions(data);
|
|
41
37
|
if (options) {
|
|
42
|
-
|
|
38
|
+
const axios = require('axios').default;
|
|
39
|
+
axios(options).then((message) => {
|
|
43
40
|
const body = adapter.endMessage(message);
|
|
44
41
|
forward.push(body);
|
|
45
42
|
done();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-duplex.js","sourceRoot":"","sources":["../../../src/transport/duplex/http-duplex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-duplex.js","sourceRoot":"","sources":["../../../src/transport/duplex/http-duplex.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAwC;AAIxC,MAAa,UAAW,SAAQ,sBAAS;IACvC,YAAoC,OAAqB;QACvD,KAAK,EAAE,CAAA;QAD2B,YAAO,GAAP,OAAO,CAAc;QAEvD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,YAAY,EAAE,CAAA;QACzC,IAAI,CAAC,Q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F,CAAA;QACD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAA;QACrC,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEM,GAAG;QACR,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;CACF;AAjDD,gCAiDC","sourcesContent":["import { FixDuplex } from './fix-duplex'\nimport { Readable, Writable } from 'stream'\nimport type { IHttpAdapter } from '../http/http-adapter'\n\nexport class HttpDuplex extends FixDuplex {\n public constructor (public readonly adapter: IHttpAdapter) {\n super()\n this.readable = HttpDuplex.makeReadable()\n this.writable = this.makeWritable()\n }\n\n private static makeReadable (): Readable {\n const Readable = require('stream').Readable\n const reader = {\n read: () => {\n // nothing\n }\n }\n return new Readable(reader)\n }\n\n private makeWritable (): Writable {\n const forward: Readable = this.readable\n const Writable = require('stream').Writable\n const writer = {\n write: async (data: Buffer, _: any, done: Function) => {\n try {\n const adapter = this.adapter\n const options = adapter.getOptions(data)\n if (options) {\n // resolved here rather than at module scope - this file is on the barrel\n // export, and an ascii application should not load axios to reach it\n const axios = require('axios').default\n axios(options).then((message: any) => {\n const body = adapter.endMessage(message)\n forward.push(body)\n done()\n }).catch((err: Error) => {\n receiver.emit('error', err)\n })\n }\n } catch (e) {\n done(e)\n }\n }\n }\n const receiver = new Writable(writer)\n return receiver\n }\n\n public end (): void {\n this.readable.push(null)\n }\n}\n"]}
|
package/docs/acceptor.md
CHANGED
|
@@ -199,6 +199,38 @@ asks for a resend, the stored bodies are replayed with `PossDupFlag=Y`.
|
|
|
199
199
|
Because the store is keyed on `SessionId`, a wildcard acceptor recovers each
|
|
200
200
|
counterparty independently.
|
|
201
201
|
|
|
202
|
+
## Closing the listener
|
|
203
|
+
|
|
204
|
+
An acceptor outlives its counterparties. A session ending closes nothing: the
|
|
205
|
+
listener stays up, waiting for the next connection, which is the whole point of a
|
|
206
|
+
venue and why `TcpAcceptorListener` never stops itself.
|
|
207
|
+
|
|
208
|
+
The consequence is worth stating plainly, because it does not look like a decision
|
|
209
|
+
from the outside — **a listening socket keeps node alive on its own**. Every session
|
|
210
|
+
can log out, every transport can be harvested, the census can read `transports=0
|
|
211
|
+
sessions=0`, and the process still will not exit. Nothing is stuck; there is simply
|
|
212
|
+
one handle left, and only the application knows when it no longer wants it.
|
|
213
|
+
|
|
214
|
+
`SessionLauncher.stop()` closes it:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
const venue = new MyLauncher(null, acceptorDescription)
|
|
218
|
+
const run = venue.run() // resolves when the listener closes, not before
|
|
219
|
+
|
|
220
|
+
process.once('SIGINT', () => { venue.stop() })
|
|
221
|
+
await run // ... and now the process can end
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`stop()` releases any live transports rather than waiting on them — `net.Server.close`
|
|
225
|
+
alone would block on whichever counterparty happened to be connected, and forever on
|
|
226
|
+
a half-open one. It is safe before the listener has opened (the request is remembered
|
|
227
|
+
and it never opens) and safe to call twice.
|
|
228
|
+
|
|
229
|
+
A launcher given *both* roles calls this for you when its client finishes, which is
|
|
230
|
+
why a single-launcher sample exits by itself. An application that gives its acceptor a
|
|
231
|
+
launcher of its own — the usual arrangement once more than one client is involved —
|
|
232
|
+
owns that decision, and must say when.
|
|
233
|
+
|
|
202
234
|
## See also
|
|
203
235
|
|
|
204
236
|
- [`src/transport/tcp/tcp-acceptor.ts`](../src/transport/tcp/tcp-acceptor.ts) — listener, transport lifecycle
|
package/jsfix.test_client.txt
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
2
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
3
|
-
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
4
|
-
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=
|
|
5
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
6
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
7
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
8
|
-
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
9
|
-
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=
|
|
10
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
11
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
12
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
13
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
14
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
15
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
16
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
17
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
18
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
19
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
20
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
21
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
22
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
23
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=
|
|
24
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
25
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=
|
|
26
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
27
|
-
8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
28
|
-
8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
29
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
30
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
31
|
-
8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
32
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
33
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
34
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
35
|
-
8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
36
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
37
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
38
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
39
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
40
|
-
8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
41
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
42
|
-
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
43
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
44
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
45
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
46
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
47
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
48
|
-
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
49
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
50
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
51
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=
|
|
52
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=
|
|
53
|
-
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
54
|
-
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
55
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
56
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
57
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
58
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=
|
|
59
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
60
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
61
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
62
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
1
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:32.371|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=102|
|
|
2
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:32.376|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=155|
|
|
3
|
+
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260810-16:58:32.377|7=1|16=1|10=243|
|
|
4
|
+
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260810-16:58:32.381|122=20260810-16:58:32.381|123=Y|36=2|10=107|
|
|
5
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:58:34.380|58=5|10=215|
|
|
6
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:37.184|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=109|
|
|
7
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:37.186|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=159|
|
|
8
|
+
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260810-16:58:37.187|7=1|16=0|10=246|
|
|
9
|
+
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260810-16:58:37.189|122=20260810-16:58:37.189|123=Y|36=2|10=129|
|
|
10
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:58:39.190|58=5|10=219|
|
|
11
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:41.673|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
|
|
12
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:41.674|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=156|
|
|
13
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=20260810-16:58:41.675|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=110|
|
|
14
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:42.221|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=097|
|
|
15
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:42.222|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=146|
|
|
16
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:58:43.225|58=5|10=213|
|
|
17
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260810-16:58:43.676|58=5|10=224|
|
|
18
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:45.999|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=122|
|
|
19
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:46.001|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=145|
|
|
20
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:58:47.004|58=5|10=212|
|
|
21
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:49.778|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=121|
|
|
22
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:49.780|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=162|
|
|
23
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=20260810-16:58:50.781|58=5|10=216|
|
|
24
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:53.307|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=104|
|
|
25
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=20260810-16:58:53.308|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=157|
|
|
26
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:58:54.311|58=5|10=211|
|
|
27
|
+
8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:58:56.796|98=0|141=Y|553=js-client|554=pwd-client|10=187|
|
|
28
|
+
8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:58:56.797|45=1|372=A|373=1|58=msgType A missing required tag 108|10=021|
|
|
29
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:01.408|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=100|
|
|
30
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:01.410|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=141|
|
|
31
|
+
8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:01.412|45=2|372=ZZ|373=11|58=msgType ZZ unknown|10=144|
|
|
32
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260810-16:59:03.412|58=5|10=209|
|
|
33
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:06.170|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=101|
|
|
34
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:06.171|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=150|
|
|
35
|
+
8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:06.173|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 143|10=074|
|
|
36
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260810-16:59:08.174|58=5|10=219|
|
|
37
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:10.172|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=098|
|
|
38
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:14.686|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=112|
|
|
39
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:14.687|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=161|
|
|
40
|
+
8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:14.689|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 59|10=042|
|
|
41
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260810-16:59:16.690|58=5|10=221|
|
|
42
|
+
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:19.174|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=059|
|
|
43
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:19.175|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=158|
|
|
44
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260810-16:59:21.180|112=Mon, 10 Aug 2026 16:59:21 GMT|10=138|
|
|
45
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260810-16:59:23.184|112=Mon, 10 Aug 2026 16:59:23 GMT|10=147|
|
|
46
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:25.177|58=5|10=220|
|
|
47
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:27.658|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=115|
|
|
48
|
+
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:27.659|98=0|108=2|141=Y|553=js-server|554=pwd-server|10=114|
|
|
49
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:29.663|112=Mon, 10 Aug 2026 16:59:29 GMT|10=160|
|
|
50
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=20260810-16:59:31.666|112=Mon, 10 Aug 2026 16:59:31 GMT|10=150|
|
|
51
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=20260810-16:59:33.669|112=Mon, 10 Aug 2026 16:59:33 GMT|10=158|
|
|
52
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=20260810-16:59:35.660|58=5|10=221|
|
|
53
|
+
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-16:59:38.419|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=062|
|
|
54
|
+
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-16:59:38.420|98=0|108=5|141=Y|553=js-server|554=pwd-server|10=105|
|
|
55
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260810-16:59:40.424|112=Mon, 10 Aug 2026 16:59:40 GMT|10=141|
|
|
56
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260810-16:59:42.428|112=Mon, 10 Aug 2026 16:59:42 GMT|10=150|
|
|
57
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-16:59:43.430|112=Mon, 10 Aug 2026 16:59:43 GMT|10=144|
|
|
58
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=20260810-16:59:44.432|112=Mon, 10 Aug 2026 16:59:44 GMT|10=150|
|
|
59
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260810-16:59:46.423|58=5|10=218|
|
|
60
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260810-17:01:54.797|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
|
|
61
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260810-17:01:54.806|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=146|
|
|
62
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260810-17:01:55.811|58=5|10=206|
|