jspurefix 5.6.2 → 5.8.4
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/DEMO_PORT_PLAN.md +1 -1
- package/README.md +263 -585
- package/dist/buffer/ascii/ascii-parser.d.ts +2 -1
- package/dist/buffer/ascii/ascii-parser.js +5 -3
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/tag/tags.d.ts +2 -1
- package/dist/buffer/tag/tags.js +8 -4
- package/dist/buffer/tag/tags.js.map +1 -1
- package/dist/transport/ascii/ascii-session.d.ts +1 -0
- package/dist/transport/ascii/ascii-session.js +51 -10
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/http/http-acceptor.js +2 -2
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/session/fix-session.d.ts +1 -0
- package/dist/transport/session/fix-session.js +7 -0
- package/dist/transport/session/fix-session.js.map +1 -1
- package/jsfix.test_client.txt +75 -71
- package/jsfix.test_server.txt +72 -68
- package/package.json +10 -12
- package/src/buffer/ascii/ascii-parser.ts +3 -2
- package/src/buffer/tag/tags.ts +8 -4
- package/src/transport/ascii/ascii-session.ts +52 -10
- package/src/transport/http/http-acceptor.ts +2 -2
- package/src/transport/session/fix-session.ts +14 -0
- package/src/util/unzip.js +54 -184
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-acceptor.js","sourceRoot":"","sources":["../../../src/transport/http/http-acceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AACzC,kDAA6C;AAG7C,sCAAuE;AAEvE,mCAAmC;AACnC,wDAAyC;AAEzC,+BAAmC;AACnC,uCAA6C;AAC7C,uDAAkD;AAG3C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,0BAAW;IAQ3C,YAA4C,MAAoC;;QAC9E,KAAK,CAAC,MAAA,M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C,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;oBACX,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACb,CAAC,CAAC,CAAA;gBACF,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA3JY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,qBAAU,GAAE;IASG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GARhC,YAAY,CA2JxB","sourcesContent":["import { MsgTransport } from '../factory'\nimport { FixAcceptor } from '../fix-acceptor'\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { IFixmlRequest } from '../fixml'\nimport { FixDuplex, StringDuplex, StringDuplexTraits } from '../duplex'\n\nimport express = require('express')\nimport * as bodyParser from 'body-parser'\nimport * as http from 'http'\nimport { v4 as uuidv4 } from 'uuid'\nimport { inject, injectable } from 'tsyringe'\nimport { DITokens } from '../../runtime/di-tokens'\n\n@injectable()\nexport class HttpAcceptor extends FixAcceptor {\n private readonly app: express.Express = express()\n private server: http.Server\n private readonly logger: IJsFixLogger\n private readonly router: express.Router\n private nextId: number = 0\n private readonly keys: Map<string, MsgTransport> = new Map<string, MsgTransport>()\n\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\n super(config?.description?.application ?? null)\n this.logger = config.logFactory.logger(`${config?.description?.application?.name}:HttpAcceptor`)\n this.logger.info('creating http server')\n this.router = express.Router()\n this.router.use(bodyParser.json())\n this.subscribe()\n this.app.use('/', this.router)\n }\n\n public listen (): void {\n const app = this.config.description.application\n const port = app?.http?.port ?? 0\n const logger = this.logger\n logger.info(`start to listen ${port}`)\n this.server = this.app.listen(port, () => {\n logger.info(`app listening at http://localhost:${port}${app?.http?.uri}`)\n })\n this.server.on('error', (err: Error) => {\n logger.error(err)\n this.emit('error', err)\n })\n }\n\n public close (callback?: (err?: Error) => void): void {\n const app = this.config.description.application\n const port = app?.http?.port\n this.logger.info(`close listener on port ${port}`)\n this.server.close(callback)\n }\n\n private saveTransport (tid: number, transport: MsgTransport): string {\n this.transports[tid] = transport\n const keys: string[] = Object.keys(this.transports)\n const a = uuidv4()\n this.keys.set(a, transport)\n this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`)\n this.emit('transport', transport)\n return a\n }\n\n private harvestTransport (token: string, tid: number): void {\n delete this.transports[tid]\n this.keys.delete(token)\n const keys: string[] = Object.keys(this.transports)\n this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)\n }\n\n private async respond (duplex: FixDuplex, response: express.Response, token: string | null = null): Promise<any> {\n return new Promise<any>((resolve, reject) => {\n response.setHeader('Content-Type', 'application/json')\n const timer = setTimeout(() => {\n const businessReject = '<FIXML><BizMsgRej BizRejRsn=\"4\" Txt=\"no response from application\"/></FIXML>'\n const b = Buffer.from(businessReject, 'utf-8')\n duplex.writable.removeListener('data', transmit)\n response.send(b)\n reject(new Error('no response'))\n }, 5000)\n\n const transmit = (d: Buffer): void => {\n this.logger.info('responding to request')\n clearTimeout(timer)\n if (token) {\n response.setHeader('authorization', token)\n }\n duplex.writable.removeListener('data', transmit)\n response.send(d)\n resolve(true)\n }\n\n duplex.writable.on('data', transmit)\n })\n }\n\n private async logon (req: express.Request, res: express.Response): Promise<void> {\n const body: IFixmlRequest = req.body\n const id = this.nextId++\n this.logger.info(JSON.stringify(body, null, 4))\n // check hand back session key\n const d = new StringDuplex('', StringDuplexTraits.None)\n const transport = new MsgTransport(id, this.config, d)\n const token = this.saveTransport(id, transport)\n this.respond(d, res, token).then(() => {\n this.logger.info('responded to logon')\n }).catch((e: Error) => {\n this.logger.error(e)\n })\n d.readable.push(body.fixml)\n }\n\n private async logout (req: express.Request, res: express.Response): Promise<void> {\n const headers = req.headers\n const body: IFixmlRequest = req.body\n const t: MsgTransport | undefined = this.keys.get(headers?.authorization ?? '')\n if (t) {\n const token = req.headers.authorization\n if (token) {\n this.harvestTransport(token, t.id)\n const d = t.duplex\n this.respond(d, res, token).then(() => {\n this.logger.info('responded to logout')\n t.end()\n }).catch((e: Error) => {\n this.logger.error(e)\n })\n d.readable.push(body.fixml)\n }\n }\n }\n\n private subscribe (): void {\n const router = this.router\n const app = this.config.description.application\n const root = app?.http?.uri\n const authorise = `${root}authorise`\n const query = `${root}query`\n this.logger.info(`uri: authorise ${authorise}, query ${query}`)\n router.post(authorise, async (req: express.Request, res: express.Response) => {\n if (!req.headers.authorization) {\n this.logger.info('logon')\n await this.logon(req, res)\n } else {\n this.logger.info('logout')\n await this.logout(req, res)\n }\n })\n\n router.get(query, async (req: express.Request, res: express.Response) => {\n const headers = req.headers\n const body: IFixmlRequest = req.body\n const t: MsgTransport | null = this.keys.get(headers.authorization ?? '') ?? null\n if (!t) {\n this.logger.info('received request with no token')\n res.send({\n error: 'no key with query'\n })\n } else {\n const d = t.duplex\n this.respond(d, res).then(() => {\n this.logger.info(`responded to ${req.url}`)\n }).catch(e => {\n res.send(e)\n })\n d.readable.push(body.fixml)\n }\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"http-acceptor.js","sourceRoot":"","sources":["../../../src/transport/http/http-acceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AACzC,kDAA6C;AAG7C,sCAAuE;AAEvE,mCAAmC;AACnC,wDAAyC;AAEzC,mCAAmC;AACnC,uCAA6C;AAC7C,uDAAkD;AAG3C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,0BAAW;IAQ3C,YAA4C,MAAoC;;QAC9E,KAAK,CAAC,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,0CAAE,WAAW,mCAAI,IAAI,CAAC,CAAA;QADW,WAAM,GAAN,MAAM,CAAc;QAP/D,QAAG,GAAo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C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA3JY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,qBAAU,GAAE;IASG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GARhC,YAAY,CA2JxB","sourcesContent":["import { MsgTransport } from '../factory'\nimport { FixAcceptor } from '../fix-acceptor'\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { IFixmlRequest } from '../fixml'\nimport { FixDuplex, StringDuplex, StringDuplexTraits } from '../duplex'\n\nimport express = require('express')\nimport * as bodyParser from 'body-parser'\nimport * as http from 'http'\nimport { randomUUID } from 'crypto'\nimport { inject, injectable } from 'tsyringe'\nimport { DITokens } from '../../runtime/di-tokens'\n\n@injectable()\nexport class HttpAcceptor extends FixAcceptor {\n private readonly app: express.Express = express()\n private server: http.Server\n private readonly logger: IJsFixLogger\n private readonly router: express.Router\n private nextId: number = 0\n private readonly keys: Map<string, MsgTransport> = new Map<string, MsgTransport>()\n\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\n super(config?.description?.application ?? null)\n this.logger = config.logFactory.logger(`${config?.description?.application?.name}:HttpAcceptor`)\n this.logger.info('creating http server')\n this.router = express.Router()\n this.router.use(bodyParser.json())\n this.subscribe()\n this.app.use('/', this.router)\n }\n\n public listen (): void {\n const app = this.config.description.application\n const port = app?.http?.port ?? 0\n const logger = this.logger\n logger.info(`start to listen ${port}`)\n this.server = this.app.listen(port, () => {\n logger.info(`app listening at http://localhost:${port}${app?.http?.uri}`)\n })\n this.server.on('error', (err: Error) => {\n logger.error(err)\n this.emit('error', err)\n })\n }\n\n public close (callback?: (err?: Error) => void): void {\n const app = this.config.description.application\n const port = app?.http?.port\n this.logger.info(`close listener on port ${port}`)\n this.server.close(callback)\n }\n\n private saveTransport (tid: number, transport: MsgTransport): string {\n this.transports[tid] = transport\n const keys: string[] = Object.keys(this.transports)\n const a = randomUUID()\n this.keys.set(a, transport)\n this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`)\n this.emit('transport', transport)\n return a\n }\n\n private harvestTransport (token: string, tid: number): void {\n delete this.transports[tid]\n this.keys.delete(token)\n const keys: string[] = Object.keys(this.transports)\n this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)\n }\n\n private async respond (duplex: FixDuplex, response: express.Response, token: string | null = null): Promise<any> {\n return new Promise<any>((resolve, reject) => {\n response.setHeader('Content-Type', 'application/json')\n const timer = setTimeout(() => {\n const businessReject = '<FIXML><BizMsgRej BizRejRsn=\"4\" Txt=\"no response from application\"/></FIXML>'\n const b = Buffer.from(businessReject, 'utf-8')\n duplex.writable.removeListener('data', transmit)\n response.send(b)\n reject(new Error('no response'))\n }, 5000)\n\n const transmit = (d: Buffer): void => {\n this.logger.info('responding to request')\n clearTimeout(timer)\n if (token) {\n response.setHeader('authorization', token)\n }\n duplex.writable.removeListener('data', transmit)\n response.send(d)\n resolve(true)\n }\n\n duplex.writable.on('data', transmit)\n })\n }\n\n private async logon (req: express.Request, res: express.Response): Promise<void> {\n const body: IFixmlRequest = req.body\n const id = this.nextId++\n this.logger.info(JSON.stringify(body, null, 4))\n // check hand back session key\n const d = new StringDuplex('', StringDuplexTraits.None)\n const transport = new MsgTransport(id, this.config, d)\n const token = this.saveTransport(id, transport)\n this.respond(d, res, token).then(() => {\n this.logger.info('responded to logon')\n }).catch((e: Error) => {\n this.logger.error(e)\n })\n d.readable.push(body.fixml)\n }\n\n private async logout (req: express.Request, res: express.Response): Promise<void> {\n const headers = req.headers\n const body: IFixmlRequest = req.body\n const t: MsgTransport | undefined = this.keys.get(headers?.authorization ?? '')\n if (t) {\n const token = req.headers.authorization\n if (token) {\n this.harvestTransport(token, t.id)\n const d = t.duplex\n this.respond(d, res, token).then(() => {\n this.logger.info('responded to logout')\n t.end()\n }).catch((e: Error) => {\n this.logger.error(e)\n })\n d.readable.push(body.fixml)\n }\n }\n }\n\n private subscribe (): void {\n const router = this.router\n const app = this.config.description.application\n const root = app?.http?.uri\n const authorise = `${root}authorise`\n const query = `${root}query`\n this.logger.info(`uri: authorise ${authorise}, query ${query}`)\n router.post(authorise, async (req: express.Request, res: express.Response) => {\n if (!req.headers.authorization) {\n this.logger.info('logon')\n await this.logon(req, res)\n } else {\n this.logger.info('logout')\n await this.logout(req, res)\n }\n })\n\n router.get(query, async (req: express.Request, res: express.Response) => {\n const headers = req.headers\n const body: IFixmlRequest = req.body\n const t: MsgTransport | null = this.keys.get(headers.authorization ?? '') ?? null\n if (!t) {\n this.logger.info('received request with no token')\n res.send({\n error: 'no key with query'\n })\n } else {\n const d = t.duplex\n this.respond(d, res).then(() => {\n this.logger.info(`responded to ${req.url}`)\n }).catch(e => {\n res.send(e)\n })\n d.readable.push(body.fixml)\n }\n })\n }\n}\n"]}
|
|
@@ -52,6 +52,7 @@ export declare abstract class FixSession extends events.EventEmitter {
|
|
|
52
52
|
done(): void;
|
|
53
53
|
reset(resetSeqNum?: number | null): void;
|
|
54
54
|
protected onPrepareForReconnect(): void;
|
|
55
|
+
protected onPreLogon(): Promise<void>;
|
|
55
56
|
protected stop(error?: Error | null): void;
|
|
56
57
|
protected abstract onMsg(msgType: string, view: MsgView): void;
|
|
57
58
|
protected abstract onDecoded(msgType: string, txt: string): void;
|
|
@@ -121,6 +121,9 @@ class FixSession extends events.EventEmitter {
|
|
|
121
121
|
waitPromise() {
|
|
122
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
123
123
|
const logger = this.sessionLogger;
|
|
124
|
+
if (this.initiator) {
|
|
125
|
+
yield this.onPreLogon();
|
|
126
|
+
}
|
|
124
127
|
return yield new Promise((resolve, reject) => {
|
|
125
128
|
if (this.initiator) {
|
|
126
129
|
logger.debug(`initiator sending logon state = ${this.stateString()}`);
|
|
@@ -393,6 +396,10 @@ class FixSession extends events.EventEmitter {
|
|
|
393
396
|
}
|
|
394
397
|
onPrepareForReconnect() {
|
|
395
398
|
}
|
|
399
|
+
onPreLogon() {
|
|
400
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
+
});
|
|
402
|
+
}
|
|
396
403
|
stop(error = null) {
|
|
397
404
|
var _a;
|
|
398
405
|
if (this.sessionState.state === session_state_1.SessionState.Stopped) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-session.js","sourceRoot":"","sources":["../../../src/transport/session/fix-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAAqD;AAErD,uCAAoC;AAGpC,+CAAgC;AAChC,mDAA8C;AAC9C,oEAA+D;AAE/D,MAAsB,UAAW,SAAQ,MAAM,CAAC,YAAY;IAe1D,YAAuC,MAAoB;;QACzD,KAAK,EAAE,CAAA;QAD8B,WAAM,GAAN,MAAM,CAAc;QAdpD,oBAAe,GAAY,KAAK,CAAA;QAC7B,UAAK,GAA0B,IAAI,CAAA;QACnC,cAAS,GAAwB,IAAI,CAAA;QACxC,kBAAa,GAAY,IAAI,CAAA;QAC7B,sBAAiB,GAAY,KAAK,CAAA;QAYvC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;QACtC,IAAI,CAAC,EAAE,GAAG,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,0CAAE,IAAI,mCAAI,IAAI,CAAA;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,mCAAe,CACrC;YACE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU;YACxC,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB;SACzD,CAAC,CAAA;QACJ,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,aAAa,CAAC,CAAA;QACtE,IAAI,CAAC,SAAS,GAAG,CAAA,MAAA,WAA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AI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,4BAAY,CAAC,OAAO,CAAC,CAAA;QACnC,IAAI,CAAC,SAAS,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACvB,CAAC;CAkEF;AAzdD,gCAydC","sourcesContent":["import { ElasticBuffer, MsgView } from '../../buffer'\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { FixSessionState } from './fix-session-state'\nimport { MsgTransport } from '../factory'\nimport { MsgTag } from '../../types'\nimport { ILooseObject } from '../../collections/collection'\n\nimport * as events from 'events'\nimport { SessionState } from './session-state'\nimport { SegmentType } from '../../buffer/segment/segment-type'\n\nexport abstract class FixSession extends events.EventEmitter {\n public logReceivedMsgs: boolean = false\n protected timer: NodeJS.Timeout | null = null\n protected transport: MsgTransport | null = null\n public manageSession: boolean = true\n public checkMsgIntegrity: boolean = false\n protected readonly me: string\n protected readonly initiator: boolean\n protected readonly acceptor: boolean\n protected readonly sessionState: FixSessionState\n protected readonly sessionLogger: IJsFixLogger\n protected requestLogoutType: string\n protected respondLogoutType: string\n protected requestLogonType: string\n\n protected constructor (public readonly config: IJsFixConfig) {\n super()\n const description = config.description\n this.me = description?.application?.name ?? 'me'\n this.sessionState = new FixSessionState(\n {\n heartBeat: config.description.HeartBtInt,\n lastPeerMsgSeqNum: config.description.LastReceivedSeqNum\n })\n this.sessionLogger = config.logFactory.logger(`${this.me}:FixSession`)\n this.initiator = description?.application?.type === 'initiator'\n this.acceptor = !this.initiator\n this.checkMsgIntegrity = this.acceptor\n this.sessionState.compId = description.SenderCompId\n }\n\n stateStr (theState: SessionState): string {\n return SessionState[theState]\n }\n\n assignState (newState: SessionState): void {\n const currentState = this.sessionState.state\n const currentStateStr = this.stateStr(currentState)\n const logger = this.sessionLogger\n const msg = `current state ${currentStateStr} (${currentState}) moves to ${SessionState[newState]} (${newState})`\n logger.info(msg)\n this.sessionState.state = newState\n }\n\n public setState (state: SessionState): void {\n const logger = this.sessionLogger\n const currentState = this.sessionState.state\n const currentStateStr = this.stateStr(currentState)\n if (state === currentState) return\n switch (currentState) {\n case SessionState.ConfirmingLogout:\n case SessionState.Stopped:\n if (state !== SessionState.NetworkConnectionEstablished) {\n logger.info(`ignoring request to change state as now already in ${currentStateStr}`)\n } else {\n this.assignState(state)\n }\n break\n\n default: {\n this.assignState(state)\n }\n }\n }\n\n public getState (): SessionState {\n return this.sessionState.state\n }\n\n public lastSentSeqNum (): number {\n return this.sessionState.lastSentSeqNum()\n }\n\n public lastPeerSeqNum (): number {\n return this.sessionState.lastPeerMsgSeqNum\n }\n\n public sendLogon (): void {\n const lo = this.config.factory?.logon()\n if (lo) {\n this.send(this.requestLogonType, lo)\n }\n }\n\n private async waitPromise (): Promise<number> {\n const logger = this.sessionLogger\n return await new Promise<any>((resolve, reject) => {\n if (this.initiator) {\n logger.debug(`initiator sending logon state = ${this.stateString()}`)\n this.sendLogon()\n this.setState(SessionState.InitiationLogonSent)\n } else {\n logger.debug(`acceptor waits for logon state = ${this.stateString()}`)\n this.setState(SessionState.WaitingForALogon)\n }\n\n this.on('error', (e: Error) => {\n logger.error(e)\n reject(e)\n })\n\n this.on('done', () => {\n resolve(this.transport?.id)\n })\n })\n }\n\n public async run (transport: MsgTransport): Promise<number> {\n const logger = this.sessionLogger\n if (this.transport) {\n logger.info(`reset from previous transport. state ${this.stateString()}`)\n this.reset()\n }\n this.transport = transport\n this.subscribe()\n return await this.waitPromise()\n }\n\n protected expectedEndState (): boolean {\n switch (this.sessionState.state) {\n case SessionState.Stopped:\n case SessionState.ConfirmingLogout:\n return true\n\n default:\n return false\n }\n }\n\n protected rxOnEnd (): void {\n const logger = this.sessionLogger\n logger.info(`rx end received sessionState = [${this.sessionState.toString()}]`)\n const expectedState = this.expectedEndState()\n if (expectedState) {\n logger.info(`rx receives end state = ${this.stateString()} - stop session`)\n this.stop()\n } else {\n this.setState(SessionState.DetectBrokenNetworkConnection)\n const e = new Error(`unexpected state - transport failed? = ${this.stateString()}`)\n logger.info(`rx error ${e.message}`)\n this.terminate(e)\n }\n }\n\n protected rxOnMsg (msgType: string, view: MsgView): void {\n const logger = this.sessionLogger\n\n if (this.logReceivedMsgs) {\n const name = view.segment.type !== SegmentType.Unknown ? view?.segment?.set?.name : 'unknown'\n logger.info(`${msgType}: ${name}`)\n logger.info(`${view.toString()}`)\n }\n this.sessionState.lastReceivedAt = new Date()\n if (this.manageSession) {\n this.onMsg(msgType, view)\n } else {\n this.checkForwardMsg(msgType, view)\n }\n }\n\n protected rxOnDone (): void {\n const logger = this.sessionLogger\n logger.info('rx done received')\n this.done()\n }\n\n protected rxOnError (e: Error): void {\n const logger = this.sessionLogger\n logger.warning(`rx error event: ${e.message} ${JSON.stringify(e)}`)\n this.terminate(e)\n }\n\n protected rxOnDecoded (msgType: string, data: ElasticBuffer, ptr: number): void {\n const logger = this.sessionLogger\n logger.debug(`rx: [${msgType}] ${ptr} bytes`)\n this.onDecoded(msgType, data.toString(ptr))\n }\n\n protected txOnError (e: Error): void {\n const logger = this.sessionLogger\n logger.warning(`tx error event: ${e.message} ${JSON.stringify(e)}`)\n this.terminate(e)\n }\n\n protected txOnEncoded (msgType: string, data: string, hdr: ILooseObject): void {\n const logger = this.sessionLogger\n this.sessionState.lastHeader = hdr\n logger.debug(`tx: [${msgType}] ${data.length} bytes seqNo = ${this.lastSentSeqNum()}`)\n this.onEncoded(msgType, data)\n }\n\n protected unsubscribe (): void {\n const logger = this.sessionLogger\n logger.info(`unsubscribe sessionState = [${this.sessionState.toString()}]`)\n const transport = this.transport\n const rx = transport?.receiver\n const tx = transport?.transmitter\n\n rx?.removeListener('msg', this.rxOnMsg)\n rx?.removeListener('error', this.rxOnError)\n rx?.removeListener('done', this.rxOnDone)\n rx?.removeListener('end', this.rxOnEnd)\n rx?.removeListener('decoded', this.rxOnDecoded)\n tx?.removeListener('error', this.txOnError)\n tx?.removeListener('encoded', this.txOnEncoded)\n }\n\n protected subscribe (): void {\n const transport = this.transport\n\n const rx = transport?.receiver\n const tx = transport?.transmitter\n const inst = this\n rx?.on('msg', (msgType: string, view: MsgView) => { inst.rxOnMsg(msgType, view) })\n rx?.on('error', (e: Error) => { inst.rxOnError(e) })\n rx?.on('done', () => { inst.rxOnDone() })\n rx?.on('end', () => { inst.rxOnEnd() })\n rx?.on('decoded', (msgType: string, data: ElasticBuffer, ptr: number) => { inst.rxOnDecoded(msgType, data, ptr) })\n tx?.on('error', (e: Error) => { inst.txOnError(e) })\n tx?.on('encoded', (msgType: string, data: string, hdr: ILooseObject) => { inst.txOnEncoded(msgType, data, hdr) })\n }\n\n protected validStateApplicationMsg (): boolean {\n switch (this.sessionState.state) {\n case SessionState.Idle:\n case SessionState.InitiateConnection:\n case SessionState.InitiationLogonSent:\n case SessionState.WaitingForALogon:\n case SessionState.HandleResendRequest:\n case SessionState.AwaitingProcessingResponseToTestRequest:\n case SessionState.AwaitingProcessingResponseToResendRequest:\n return false\n default:\n return true\n }\n }\n\n protected stateString (): string {\n return SessionState[this.sessionState.state]\n }\n\n protected checkForwardMsg (msgType: string, view: MsgView): void {\n this.sessionLogger.info(`forwarding msgType = '${msgType}' to application`)\n this.setState(SessionState.ActiveNormalSession)\n this.onApplicationMsg(msgType, view)\n }\n\n private stopTimer (): void {\n if (this.timer) {\n this.sessionLogger.info('stopTimer')\n clearInterval(this.timer)\n this.timer = null\n }\n }\n\n protected terminate (error: Error): void {\n if (this.sessionState.state === SessionState.Stopped) return\n this.sessionLogger.error(error)\n this.stopTimer()\n if (this.transport) {\n this.transport.end()\n }\n this.transport = null\n this.setState(SessionState.Stopped)\n this.emit('error', error)\n }\n\n protected peerLogout (view: MsgView): void {\n const msg = view.getString(MsgTag.Text)\n const state = this.sessionState.state\n switch (state) {\n case SessionState.WaitingLogoutConfirm: {\n this.sessionLogger.info(`peer confirms logout Text = '${msg}'`)\n this.stop()\n break\n }\n\n case SessionState.InitiationLogonResponse:\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonReceived: {\n this.setState(SessionState.ConfirmingLogout)\n this.sessionLogger.info(`peer initiates logout Text = '${msg}'`)\n this.sessionLogout()\n }\n }\n }\n\n protected send (msgType: string, obj: ILooseObject): void {\n const state = this.sessionState.state\n switch (state) {\n case SessionState.Stopped: {\n this.sessionLogger.warning(`can't send in state ${this.stateString()}`)\n break\n }\n\n default: {\n this.sessionState.LastSentAt = new Date()\n this.transport?.transmitter.send(msgType, obj)\n break\n }\n }\n }\n\n protected sendLogout (msg: string): void {\n const factory = this.config.factory\n this.sessionLogger.info(`sending logout with ${msg}`)\n const lo = factory?.logout(this.requestLogoutType, msg)\n if (lo) {\n this.send(this.requestLogoutType, lo)\n }\n }\n\n protected sessionLogout (): void {\n const sessionState = this.sessionState\n if (sessionState.logoutSentAt) {\n return\n }\n\n switch (sessionState.state) {\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonResponse:\n case SessionState.InitiationLogonReceived: {\n // this instance initiates logout\n this.setState(SessionState.WaitingLogoutConfirm)\n sessionState.logoutSentAt = new Date()\n const msg = `${this.me} initiate logout`\n this.sessionLogger.info(msg)\n this.sendLogout(msg)\n break\n }\n\n case SessionState.ConfirmingLogout: {\n // this instance responds to log out\n this.setState(SessionState.ConfirmingLogout)\n sessionState.logoutSentAt = new Date()\n const msg = `${this.me} confirming logout`\n this.sessionLogger.info(msg)\n this.sendLogout(msg)\n break\n }\n\n default: {\n this.sessionLogger.info(`sessionLogout ignored as in state ${sessionState.state}`)\n }\n }\n }\n\n public done (): void {\n switch (this.sessionState.state) {\n case SessionState.InitiationLogonResponse:\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonReceived: {\n this.sessionLogout()\n break\n }\n\n case SessionState.Stopped:\n this.sessionLogger.info('done. session is now stopped')\n break\n\n default: {\n this.stop()\n break\n }\n }\n this.sessionLogger.info(`done. check logout sequence state ${this.stateString()}`)\n }\n\n public reset (resetSeqNum?: number | null): void {\n this.stopTimer()\n // unsubscribe from old transport before clearing reference\n this.unsubscribe()\n // reset parser to clear any partial message state from dropped connection\n const receiver: any = this.transport?.receiver\n if (receiver?.reset) {\n receiver.reset()\n }\n this.transport = null\n const resetFlag = this.config.description.ResetSeqNumFlag\n const seqNum = resetFlag ? 0 : resetSeqNum ?? this.sessionState.lastPeerMsgSeqNum\n this.sessionState.reset(seqNum) // from header def ... eventually\n this.onPrepareForReconnect()\n this.setState(SessionState.NetworkConnectionEstablished)\n }\n\n protected onPrepareForReconnect (): void {\n // Override in subclass to reset coordinator/transient state\n }\n\n protected stop (error: Error | null = null): void {\n if (this.sessionState.state === SessionState.Stopped) {\n return\n }\n this.stopTimer()\n this.unsubscribe()\n this.sessionLogger.info('stop: kill transport')\n this.transport?.end()\n if (error) {\n this.sessionLogger.info(`stop: emit error ${error.message}`)\n this.emit('error', error)\n } else {\n this.emit('done')\n }\n\n this.setState(SessionState.Stopped)\n this.onStopped(error ?? undefined)\n this.transport = null\n }\n\n /**\n * dispatches a message into the subclass that inherits from FixSession. The view contains\n * the parsed message which has utility methods such as toObject(). The Ascii session provides\n * an implementation to handle admin level messages such as logon, hearbeat and resest request.\n * Any application messges are dispatched via onApplicationMsg where the application can action\n * the message.\n * @param msgType the string based msg type the view represents\n * @param view container for all parsed fields representing the received message.\n * @protected\n */\n protected abstract onMsg (msgType: string, view: MsgView): void\n /**\n * the parsed txt recieved from the peer application. Given the applicaton is\n * responible for maintaining the fix log, this can be used to persist all received\n * messages.\n * @param msgType the string based msg type the view represents\n * @param txt the received message where for Ascii, the wire SOH delimeter is replaced\n * with that specified in the config e.g. '|'\n * @protected\n */\n protected abstract onDecoded (msgType: string, txt: string): void\n /**\n * the formatted txt sent to the peer application as an outbound message. Given the applicaton is\n * responible for maintaining the fix log, this can be used to persist all transmitted\n * messages. use msgType for example to persist only trade capture messages to database\n * @param msgType the msg type representing the message.\n * @param txt the sent message where for Ascii, the wire SOH delimeter is replaced\n * with that specified in the config e.g. '|'\n * @protected\n */\n protected abstract onEncoded (msgType: string, txt: string): void\n /**\n * typically all session level messages are handled by AsciiSession and these are\n * application level such as MarketDataRefresh. This will represent the applications main\n * work functiono where responses can be sent back to the peer. If manageSession has been set false\n * (not recommended) all messages are sent to this function\n * @param msgType the msg type representing the message.\n * @param view a wrapper containing the parsed message received.\n * @protected\n */\n protected abstract onApplicationMsg (msgType: string, view: MsgView): void\n /**\n * at this point the application is ready to send messages - peer login has been achieved\n * and the session can be considered ready to use. In the case of an initiator the application\n * may at this point send for security definitions or send market data subscriptions\n * @param view the login message causing session to be ready\n * @protected\n */\n protected abstract onReady (view: MsgView): void\n\n /**\n * Inform application this session has now ended - either from logout or connection dropped\n * @param error if session has been terminated via an error it is provided\n * @protected\n */\n protected abstract onStopped (error?: Error): void\n /**\n * Placeholder infomring the application of a peer login attempt.\n * @param view the login message\n * @param user extracted user from message\n * @param password extracted password from the message.\n * @protected\n */\n protected abstract onLogon (view: MsgView, user: string, password: string): boolean\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fix-session.js","sourceRoot":"","sources":["../../../src/transport/session/fix-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAAqD;AAErD,uCAAoC;AAGpC,+CAAgC;AAChC,mDAA8C;AAC9C,oEAA+D;AAE/D,MAAsB,UAAW,SAAQ,MAAM,CAAC,YAAY;IAe1D,YAAuC,MAAoB;;QACzD,KAAK,EAAE,CAAA;QAD8B,WAAM,GAAN,MAAM,CAAc;QAdpD,oBAAe,GAAY,KAAK,CAAA;QAC7B,UAAK,GAA0B,IAAI,CAAA;QACnC,cAAS,GAAwB,IAAI,CAAA;QACxC,kBAAa,GAAY,IAAI,CAAA;QAC7B,sBAAiB,GAAY,KAAK,CAAA;QAYvC,MAA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E,CAAA;QAC5B,IAAI,CAAC,QAAQ,CAAC,4BAAY,CAAC,4BAA4B,CAAC,CAAA;IAC1D,CAAC;IAES,qBAAqB;IAE/B,CAAC;IAOe,UAAU;;QAE1B,CAAC;KAAA;IAES,IAAI,CAAE,QAAsB,IAAI;;QACxC,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,KAAK,4BAAY,CAAC,OAAO,EAAE,CAAC;YACrD,OAAM;QACR,CAAC;QACD,IAAI,CAAC,SAAS,EAAE,CAAA;QAChB,IAAI,CAAC,WAAW,EAAE,CAAA;QAClB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QAC/C,MAAA,IAAI,CAAC,SAAS,0CAAE,GAAG,EAAE,CAAA;QACrB,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YAC5D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,4BAAY,CAAC,OAAO,CAAC,CAAA;QACnC,IAAI,CAAC,SAAS,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACvB,CAAC;CAkEF;AAveD,gCAueC","sourcesContent":["import { ElasticBuffer, MsgView } from '../../buffer'\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { FixSessionState } from './fix-session-state'\nimport { MsgTransport } from '../factory'\nimport { MsgTag } from '../../types'\nimport { ILooseObject } from '../../collections/collection'\n\nimport * as events from 'events'\nimport { SessionState } from './session-state'\nimport { SegmentType } from '../../buffer/segment/segment-type'\n\nexport abstract class FixSession extends events.EventEmitter {\n public logReceivedMsgs: boolean = false\n protected timer: NodeJS.Timeout | null = null\n protected transport: MsgTransport | null = null\n public manageSession: boolean = true\n public checkMsgIntegrity: boolean = false\n protected readonly me: string\n protected readonly initiator: boolean\n protected readonly acceptor: boolean\n protected readonly sessionState: FixSessionState\n protected readonly sessionLogger: IJsFixLogger\n protected requestLogoutType: string\n protected respondLogoutType: string\n protected requestLogonType: string\n\n protected constructor (public readonly config: IJsFixConfig) {\n super()\n const description = config.description\n this.me = description?.application?.name ?? 'me'\n this.sessionState = new FixSessionState(\n {\n heartBeat: config.description.HeartBtInt,\n lastPeerMsgSeqNum: config.description.LastReceivedSeqNum\n })\n this.sessionLogger = config.logFactory.logger(`${this.me}:FixSession`)\n this.initiator = description?.application?.type === 'initiator'\n this.acceptor = !this.initiator\n this.checkMsgIntegrity = this.acceptor\n this.sessionState.compId = description.SenderCompId\n }\n\n stateStr (theState: SessionState): string {\n return SessionState[theState]\n }\n\n assignState (newState: SessionState): void {\n const currentState = this.sessionState.state\n const currentStateStr = this.stateStr(currentState)\n const logger = this.sessionLogger\n const msg = `current state ${currentStateStr} (${currentState}) moves to ${SessionState[newState]} (${newState})`\n logger.info(msg)\n this.sessionState.state = newState\n }\n\n public setState (state: SessionState): void {\n const logger = this.sessionLogger\n const currentState = this.sessionState.state\n const currentStateStr = this.stateStr(currentState)\n if (state === currentState) return\n switch (currentState) {\n case SessionState.ConfirmingLogout:\n case SessionState.Stopped:\n if (state !== SessionState.NetworkConnectionEstablished) {\n logger.info(`ignoring request to change state as now already in ${currentStateStr}`)\n } else {\n this.assignState(state)\n }\n break\n\n default: {\n this.assignState(state)\n }\n }\n }\n\n public getState (): SessionState {\n return this.sessionState.state\n }\n\n public lastSentSeqNum (): number {\n return this.sessionState.lastSentSeqNum()\n }\n\n public lastPeerSeqNum (): number {\n return this.sessionState.lastPeerMsgSeqNum\n }\n\n public sendLogon (): void {\n const lo = this.config.factory?.logon()\n if (lo) {\n this.send(this.requestLogonType, lo)\n }\n }\n\n private async waitPromise (): Promise<number> {\n const logger = this.sessionLogger\n if (this.initiator) {\n // Hook for subclasses to reset sequences when ResetSeqNumFlag=Y is configured —\n // must run after the store is loaded, before sendLogon stamps a seq num.\n await this.onPreLogon()\n }\n return await new Promise<any>((resolve, reject) => {\n if (this.initiator) {\n logger.debug(`initiator sending logon state = ${this.stateString()}`)\n this.sendLogon()\n this.setState(SessionState.InitiationLogonSent)\n } else {\n logger.debug(`acceptor waits for logon state = ${this.stateString()}`)\n this.setState(SessionState.WaitingForALogon)\n }\n\n this.on('error', (e: Error) => {\n logger.error(e)\n reject(e)\n })\n\n this.on('done', () => {\n resolve(this.transport?.id)\n })\n })\n }\n\n public async run (transport: MsgTransport): Promise<number> {\n const logger = this.sessionLogger\n if (this.transport) {\n logger.info(`reset from previous transport. state ${this.stateString()}`)\n this.reset()\n }\n this.transport = transport\n this.subscribe()\n return await this.waitPromise()\n }\n\n protected expectedEndState (): boolean {\n switch (this.sessionState.state) {\n case SessionState.Stopped:\n case SessionState.ConfirmingLogout:\n return true\n\n default:\n return false\n }\n }\n\n protected rxOnEnd (): void {\n const logger = this.sessionLogger\n logger.info(`rx end received sessionState = [${this.sessionState.toString()}]`)\n const expectedState = this.expectedEndState()\n if (expectedState) {\n logger.info(`rx receives end state = ${this.stateString()} - stop session`)\n this.stop()\n } else {\n this.setState(SessionState.DetectBrokenNetworkConnection)\n const e = new Error(`unexpected state - transport failed? = ${this.stateString()}`)\n logger.info(`rx error ${e.message}`)\n this.terminate(e)\n }\n }\n\n protected rxOnMsg (msgType: string, view: MsgView): void {\n const logger = this.sessionLogger\n\n if (this.logReceivedMsgs) {\n const name = view.segment.type !== SegmentType.Unknown ? view?.segment?.set?.name : 'unknown'\n logger.info(`${msgType}: ${name}`)\n logger.info(`${view.toString()}`)\n }\n this.sessionState.lastReceivedAt = new Date()\n if (this.manageSession) {\n this.onMsg(msgType, view)\n } else {\n this.checkForwardMsg(msgType, view)\n }\n }\n\n protected rxOnDone (): void {\n const logger = this.sessionLogger\n logger.info('rx done received')\n this.done()\n }\n\n protected rxOnError (e: Error): void {\n const logger = this.sessionLogger\n logger.warning(`rx error event: ${e.message} ${JSON.stringify(e)}`)\n this.terminate(e)\n }\n\n protected rxOnDecoded (msgType: string, data: ElasticBuffer, ptr: number): void {\n const logger = this.sessionLogger\n logger.debug(`rx: [${msgType}] ${ptr} bytes`)\n this.onDecoded(msgType, data.toString(ptr))\n }\n\n protected txOnError (e: Error): void {\n const logger = this.sessionLogger\n logger.warning(`tx error event: ${e.message} ${JSON.stringify(e)}`)\n this.terminate(e)\n }\n\n protected txOnEncoded (msgType: string, data: string, hdr: ILooseObject): void {\n const logger = this.sessionLogger\n this.sessionState.lastHeader = hdr\n logger.debug(`tx: [${msgType}] ${data.length} bytes seqNo = ${this.lastSentSeqNum()}`)\n this.onEncoded(msgType, data)\n }\n\n protected unsubscribe (): void {\n const logger = this.sessionLogger\n logger.info(`unsubscribe sessionState = [${this.sessionState.toString()}]`)\n const transport = this.transport\n const rx = transport?.receiver\n const tx = transport?.transmitter\n\n rx?.removeListener('msg', this.rxOnMsg)\n rx?.removeListener('error', this.rxOnError)\n rx?.removeListener('done', this.rxOnDone)\n rx?.removeListener('end', this.rxOnEnd)\n rx?.removeListener('decoded', this.rxOnDecoded)\n tx?.removeListener('error', this.txOnError)\n tx?.removeListener('encoded', this.txOnEncoded)\n }\n\n protected subscribe (): void {\n const transport = this.transport\n\n const rx = transport?.receiver\n const tx = transport?.transmitter\n const inst = this\n rx?.on('msg', (msgType: string, view: MsgView) => { inst.rxOnMsg(msgType, view) })\n rx?.on('error', (e: Error) => { inst.rxOnError(e) })\n rx?.on('done', () => { inst.rxOnDone() })\n rx?.on('end', () => { inst.rxOnEnd() })\n rx?.on('decoded', (msgType: string, data: ElasticBuffer, ptr: number) => { inst.rxOnDecoded(msgType, data, ptr) })\n tx?.on('error', (e: Error) => { inst.txOnError(e) })\n tx?.on('encoded', (msgType: string, data: string, hdr: ILooseObject) => { inst.txOnEncoded(msgType, data, hdr) })\n }\n\n protected validStateApplicationMsg (): boolean {\n switch (this.sessionState.state) {\n case SessionState.Idle:\n case SessionState.InitiateConnection:\n case SessionState.InitiationLogonSent:\n case SessionState.WaitingForALogon:\n case SessionState.HandleResendRequest:\n case SessionState.AwaitingProcessingResponseToTestRequest:\n case SessionState.AwaitingProcessingResponseToResendRequest:\n return false\n default:\n return true\n }\n }\n\n protected stateString (): string {\n return SessionState[this.sessionState.state]\n }\n\n protected checkForwardMsg (msgType: string, view: MsgView): void {\n this.sessionLogger.info(`forwarding msgType = '${msgType}' to application`)\n this.setState(SessionState.ActiveNormalSession)\n this.onApplicationMsg(msgType, view)\n }\n\n private stopTimer (): void {\n if (this.timer) {\n this.sessionLogger.info('stopTimer')\n clearInterval(this.timer)\n this.timer = null\n }\n }\n\n protected terminate (error: Error): void {\n if (this.sessionState.state === SessionState.Stopped) return\n this.sessionLogger.error(error)\n this.stopTimer()\n if (this.transport) {\n this.transport.end()\n }\n this.transport = null\n this.setState(SessionState.Stopped)\n this.emit('error', error)\n }\n\n protected peerLogout (view: MsgView): void {\n const msg = view.getString(MsgTag.Text)\n const state = this.sessionState.state\n switch (state) {\n case SessionState.WaitingLogoutConfirm: {\n this.sessionLogger.info(`peer confirms logout Text = '${msg}'`)\n this.stop()\n break\n }\n\n case SessionState.InitiationLogonResponse:\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonReceived: {\n this.setState(SessionState.ConfirmingLogout)\n this.sessionLogger.info(`peer initiates logout Text = '${msg}'`)\n this.sessionLogout()\n }\n }\n }\n\n protected send (msgType: string, obj: ILooseObject): void {\n const state = this.sessionState.state\n switch (state) {\n case SessionState.Stopped: {\n this.sessionLogger.warning(`can't send in state ${this.stateString()}`)\n break\n }\n\n default: {\n this.sessionState.LastSentAt = new Date()\n this.transport?.transmitter.send(msgType, obj)\n break\n }\n }\n }\n\n protected sendLogout (msg: string): void {\n const factory = this.config.factory\n this.sessionLogger.info(`sending logout with ${msg}`)\n const lo = factory?.logout(this.requestLogoutType, msg)\n if (lo) {\n this.send(this.requestLogoutType, lo)\n }\n }\n\n protected sessionLogout (): void {\n const sessionState = this.sessionState\n if (sessionState.logoutSentAt) {\n return\n }\n\n switch (sessionState.state) {\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonResponse:\n case SessionState.InitiationLogonReceived: {\n // this instance initiates logout\n this.setState(SessionState.WaitingLogoutConfirm)\n sessionState.logoutSentAt = new Date()\n const msg = `${this.me} initiate logout`\n this.sessionLogger.info(msg)\n this.sendLogout(msg)\n break\n }\n\n case SessionState.ConfirmingLogout: {\n // this instance responds to log out\n this.setState(SessionState.ConfirmingLogout)\n sessionState.logoutSentAt = new Date()\n const msg = `${this.me} confirming logout`\n this.sessionLogger.info(msg)\n this.sendLogout(msg)\n break\n }\n\n default: {\n this.sessionLogger.info(`sessionLogout ignored as in state ${sessionState.state}`)\n }\n }\n }\n\n public done (): void {\n switch (this.sessionState.state) {\n case SessionState.InitiationLogonResponse:\n case SessionState.ActiveNormalSession:\n case SessionState.InitiationLogonReceived: {\n this.sessionLogout()\n break\n }\n\n case SessionState.Stopped:\n this.sessionLogger.info('done. session is now stopped')\n break\n\n default: {\n this.stop()\n break\n }\n }\n this.sessionLogger.info(`done. check logout sequence state ${this.stateString()}`)\n }\n\n public reset (resetSeqNum?: number | null): void {\n this.stopTimer()\n // unsubscribe from old transport before clearing reference\n this.unsubscribe()\n // reset parser to clear any partial message state from dropped connection\n const receiver: any = this.transport?.receiver\n if (receiver?.reset) {\n receiver.reset()\n }\n this.transport = null\n const resetFlag = this.config.description.ResetSeqNumFlag\n const seqNum = resetFlag ? 0 : resetSeqNum ?? this.sessionState.lastPeerMsgSeqNum\n this.sessionState.reset(seqNum) // from header def ... eventually\n this.onPrepareForReconnect()\n this.setState(SessionState.NetworkConnectionEstablished)\n }\n\n protected onPrepareForReconnect (): void {\n // Override in subclass to reset coordinator/transient state\n }\n\n /**\n * Called for initiators after the store is loaded but before the Logon is sent.\n * Override to reset sequences/store when ResetSeqNumFlag=Y so the Logon goes out\n * with MsgSeqNum=1 instead of the recovered sender seq num.\n */\n protected async onPreLogon (): Promise<void> {\n // Default no-op\n }\n\n protected stop (error: Error | null = null): void {\n if (this.sessionState.state === SessionState.Stopped) {\n return\n }\n this.stopTimer()\n this.unsubscribe()\n this.sessionLogger.info('stop: kill transport')\n this.transport?.end()\n if (error) {\n this.sessionLogger.info(`stop: emit error ${error.message}`)\n this.emit('error', error)\n } else {\n this.emit('done')\n }\n\n this.setState(SessionState.Stopped)\n this.onStopped(error ?? undefined)\n this.transport = null\n }\n\n /**\n * dispatches a message into the subclass that inherits from FixSession. The view contains\n * the parsed message which has utility methods such as toObject(). The Ascii session provides\n * an implementation to handle admin level messages such as logon, hearbeat and resest request.\n * Any application messges are dispatched via onApplicationMsg where the application can action\n * the message.\n * @param msgType the string based msg type the view represents\n * @param view container for all parsed fields representing the received message.\n * @protected\n */\n protected abstract onMsg (msgType: string, view: MsgView): void\n /**\n * the parsed txt recieved from the peer application. Given the applicaton is\n * responible for maintaining the fix log, this can be used to persist all received\n * messages.\n * @param msgType the string based msg type the view represents\n * @param txt the received message where for Ascii, the wire SOH delimeter is replaced\n * with that specified in the config e.g. '|'\n * @protected\n */\n protected abstract onDecoded (msgType: string, txt: string): void\n /**\n * the formatted txt sent to the peer application as an outbound message. Given the applicaton is\n * responible for maintaining the fix log, this can be used to persist all transmitted\n * messages. use msgType for example to persist only trade capture messages to database\n * @param msgType the msg type representing the message.\n * @param txt the sent message where for Ascii, the wire SOH delimeter is replaced\n * with that specified in the config e.g. '|'\n * @protected\n */\n protected abstract onEncoded (msgType: string, txt: string): void\n /**\n * typically all session level messages are handled by AsciiSession and these are\n * application level such as MarketDataRefresh. This will represent the applications main\n * work functiono where responses can be sent back to the peer. If manageSession has been set false\n * (not recommended) all messages are sent to this function\n * @param msgType the msg type representing the message.\n * @param view a wrapper containing the parsed message received.\n * @protected\n */\n protected abstract onApplicationMsg (msgType: string, view: MsgView): void\n /**\n * at this point the application is ready to send messages - peer login has been achieved\n * and the session can be considered ready to use. In the case of an initiator the application\n * may at this point send for security definitions or send market data subscriptions\n * @param view the login message causing session to be ready\n * @protected\n */\n protected abstract onReady (view: MsgView): void\n\n /**\n * Inform application this session has now ended - either from logout or connection dropped\n * @param error if session has been terminated via an error it is provided\n * @protected\n */\n protected abstract onStopped (error?: Error): void\n /**\n * Placeholder infomring the application of a peer login attempt.\n * @param view the login message\n * @param user extracted user from message\n * @param password extracted password from the message.\n * @protected\n */\n protected abstract onLogon (view: MsgView, user: string, password: string): boolean\n}\n"]}
|
package/jsfix.test_client.txt
CHANGED
|
@@ -1,71 +1,75 @@
|
|
|
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=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
7
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
8
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
9
|
-
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
10
|
-
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=
|
|
11
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
12
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
13
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
14
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
15
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
16
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
17
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
18
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
19
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
20
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|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=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
24
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
25
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
26
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
27
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=
|
|
28
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
29
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=
|
|
30
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
31
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
32
|
-
8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
33
|
-
8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
34
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
35
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
36
|
-
8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
37
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
38
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
39
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
40
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
41
|
-
8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
42
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
43
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
44
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
45
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
46
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
47
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
48
|
-
8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
49
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
50
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
51
|
-
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
52
|
-
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
53
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
54
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
55
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
56
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=4|57=fix|52=
|
|
57
|
-
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
58
|
-
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
59
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
60
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
61
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=
|
|
62
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=
|
|
63
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
64
|
-
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=
|
|
65
|
-
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=
|
|
66
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=
|
|
67
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=
|
|
68
|
-
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=
|
|
69
|
-
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=
|
|
70
|
-
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=
|
|
71
|
-
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=5|57=fix|52=
|
|
1
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:29.697|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=116|
|
|
2
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:29.702|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=151|
|
|
3
|
+
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:29.702|7=1|16=1|10=238|
|
|
4
|
+
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260627-11:27:29.707|122=20260627-11:27:29.707|123=Y|36=2|10=117|
|
|
5
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:31.707|58=5|10=212|
|
|
6
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:27:31.705|58=5|10=211|
|
|
7
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:34.546|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=105|
|
|
8
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:34.548|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=155|
|
|
9
|
+
8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:34.549|7=1|16=0|10=242|
|
|
10
|
+
8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260627-11:27:34.551|122=20260627-11:27:34.551|123=Y|36=2|10=103|
|
|
11
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:36.551|58=5|10=214|
|
|
12
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:27:36.550|58=5|10=214|
|
|
13
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:39.042|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=101|
|
|
14
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:39.044|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=151|
|
|
15
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:39.044|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=104|
|
|
16
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:39.579|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=116|
|
|
17
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:39.580|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=156|
|
|
18
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:40.583|58=5|10=214|
|
|
19
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:40.582|58=5|10=213|
|
|
20
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:27:41.045|58=5|10=209|
|
|
21
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:43.284|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=104|
|
|
22
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:43.285|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=153|
|
|
23
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:44.288|58=5|10=220|
|
|
24
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:44.287|58=5|10=219|
|
|
25
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:47.058|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
|
|
26
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:47.059|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=156|
|
|
27
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=20260627-11:27:48.061|58=5|10=211|
|
|
28
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:50.563|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=102|
|
|
29
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=20260627-11:27:50.564|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=155|
|
|
30
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:51.566|58=5|10=217|
|
|
31
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:27:51.565|58=5|10=216|
|
|
32
|
+
8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:54.044|98=0|141=Y|553=js-client|554=pwd-client|10=168|
|
|
33
|
+
8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:54.045|45=1|372=A|373=1|58=msgType A missing required tag 108|10=002|
|
|
34
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:27:58.638|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=113|
|
|
35
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:27:58.640|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=154|
|
|
36
|
+
8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:27:58.641|45=2|372=ZZ|373=11|58=msgType ZZ unknown|10=156|
|
|
37
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260627-11:28:00.643|58=5|10=209|
|
|
38
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:28:00.642|58=5|10=208|
|
|
39
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:03.398|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
|
|
40
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:28:03.400|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=139|
|
|
41
|
+
8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:28:03.403|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 143|10=064|
|
|
42
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260627-11:28:05.404|58=5|10=209|
|
|
43
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:28:05.403|58=5|10=208|
|
|
44
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:07.400|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=095|
|
|
45
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:07.400|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=095|
|
|
46
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:11.905|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=100|
|
|
47
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:28:11.906|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=149|
|
|
48
|
+
8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:28:11.907|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 59|10=029|
|
|
49
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260627-11:28:13.907|58=5|10=216|
|
|
50
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:28:13.906|58=5|10=215|
|
|
51
|
+
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:16.395|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=058|
|
|
52
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:28:16.396|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=157|
|
|
53
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:28:18.402|112=Sat, 27 Jun 2026 11:28:18 GMT|10=157|
|
|
54
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:28:20.404|112=Sat, 27 Jun 2026 11:28:20 GMT|10=146|
|
|
55
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:28:22.399|58=5|10=220|
|
|
56
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=4|57=fix|52=20260627-11:28:22.398|58=5|10=221|
|
|
57
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:24.881|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
|
|
58
|
+
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:28:24.882|98=0|108=2|141=Y|553=js-server|554=pwd-server|10=106|
|
|
59
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:28:26.887|112=Sat, 27 Jun 2026 11:28:26 GMT|10=172|
|
|
60
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=20260627-11:28:28.892|112=Sat, 27 Jun 2026 11:28:28 GMT|10=173|
|
|
61
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=20260627-11:28:30.895|112=Sat, 27 Jun 2026 11:28:30 GMT|10=163|
|
|
62
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=20260627-11:28:32.884|58=5|10=223|
|
|
63
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:28:32.883|58=5|10=219|
|
|
64
|
+
8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:28:35.599|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=065|
|
|
65
|
+
8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:28:35.600|98=0|108=5|141=Y|553=js-server|554=pwd-server|10=099|
|
|
66
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:28:37.604|112=Sat, 27 Jun 2026 11:28:37 GMT|10=163|
|
|
67
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260627-11:28:39.608|112=Sat, 27 Jun 2026 11:28:39 GMT|10=172|
|
|
68
|
+
8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:28:40.609|112=Sat, 27 Jun 2026 11:28:40 GMT|10=156|
|
|
69
|
+
8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=20260627-11:28:41.611|112=Sat, 27 Jun 2026 11:28:41 GMT|10=153|
|
|
70
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260627-11:28:43.602|58=5|10=211|
|
|
71
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=5|57=fix|52=20260627-11:28:43.602|58=5|10=213|
|
|
72
|
+
8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260627-11:30:11.370|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=089|
|
|
73
|
+
8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260627-11:30:11.380|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=138|
|
|
74
|
+
8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260627-11:30:12.385|58=5|10=207|
|
|
75
|
+
8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=2|57=fix|52=20260627-11:30:12.383|58=5|10=205|
|