jspurefix 1.1.2 → 1.4.1
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/.travis.yml +1 -1
- package/README.md +48 -2
- package/appveyor.yml +43 -11
- package/data/FIX44-MD.xml +6596 -0
- package/data/examples/FIX.4.4/jsfix.test_client.txt +15 -13
- package/data/session/test-qf44-acceptor.json +21 -0
- package/data/session/test-qf44-initiator.json +22 -0
- package/dist/buffer/ascii/ascii-encoder.d.ts +9 -2
- package/dist/buffer/ascii/ascii-encoder.js +72 -31
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +1 -0
- package/dist/buffer/ascii/ascii-parser.js +7 -1
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.d.ts +0 -2
- package/dist/buffer/ascii/ascii-segment-parser.js +19 -25
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +2 -0
- package/dist/buffer/ascii/ascii-view.js +4 -0
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/ascii-chars.d.ts +1 -0
- package/dist/buffer/ascii-chars.js +1 -0
- package/dist/buffer/ascii-chars.js.map +1 -1
- package/dist/buffer/elastic-buffer.d.ts +1 -0
- package/dist/buffer/elastic-buffer.js +8 -0
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.d.ts +3 -0
- package/dist/buffer/fixml/fixml-encoder.js +6 -0
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +2 -0
- package/dist/buffer/fixml/fixml-view.js +3 -0
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/msg-encoder.d.ts +2 -0
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +2 -0
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/tags.js +5 -5
- package/dist/buffer/tags.js.map +1 -1
- package/dist/collections/dictionary.d.ts +1 -0
- package/dist/collections/dictionary.js +5 -0
- package/dist/collections/dictionary.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +2 -0
- package/dist/config/js-fix-config.js +1 -0
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/dict-parser.js +2 -2
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-set-parser.js +11 -4
- package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.js +4 -0
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +15 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/jsfix-cmd.js +2 -1
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/sample/http/oms/app.js +2 -0
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/launcher.d.ts +3 -2
- package/dist/sample/launcher.js +12 -3
- package/dist/sample/launcher.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → qf-md}/app.d.ts +0 -0
- package/dist/sample/tcp/qf-md/app.js +22 -0
- package/dist/sample/tcp/qf-md/app.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-client.d.ts +15 -0
- package/dist/sample/tcp/qf-md/md-client.js +42 -0
- package/dist/sample/tcp/qf-md/md-client.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-factory.d.ts +4 -0
- package/dist/sample/tcp/qf-md/md-factory.js +35 -0
- package/dist/sample/tcp/qf-md/md-factory.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-server.d.ts +16 -0
- package/dist/sample/tcp/qf-md/md-server.js +44 -0
- package/dist/sample/tcp/qf-md/md-server.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -0
- package/dist/sample/tcp/recovering-skeleton/app.js +27 -0
- package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +2 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js +3 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +7 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +52 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +16 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +45 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.d.ts +16 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +52 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -0
- package/dist/sample/tcp/skeleton/app.js +2 -0
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.d.ts +5 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +22 -3
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app.d.ts +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/app.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/app.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.d.ts +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.js +8 -4
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.js +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js.map +1 -1
- package/dist/store/fix-msg-ascii-store-resend.d.ts +6 -2
- package/dist/store/fix-msg-ascii-store-resend.js +49 -22
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.d.ts +11 -8
- package/dist/store/fix-msg-memory-store.js +108 -42
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.d.ts +7 -3
- package/dist/store/fix-msg-store-record.js +5 -1
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-msg-store.d.ts +13 -9
- package/dist/store/fix-msg-store.js.map +1 -1
- package/dist/test/ascii-encode.test.js +20 -3
- package/dist/test/ascii-encode.test.js.map +1 -1
- package/dist/test/ascii-encoder.test.d.ts +1 -0
- package/dist/test/ascii-encoder.test.js +505 -0
- package/dist/test/ascii-encoder.test.js.map +1 -0
- package/dist/test/ascii-parser.test.js +8 -6
- package/dist/test/ascii-parser.test.js.map +1 -1
- package/dist/test/ascii-segment.test.js +6 -5
- package/dist/test/ascii-segment.test.js.map +1 -1
- package/dist/test/ascii-store-replay.test.js +59 -44
- package/dist/test/ascii-store-replay.test.js.map +1 -1
- package/dist/test/logon.test.js +1 -1
- package/dist/test/logon.test.js.map +1 -1
- package/dist/test/memory-store.test.js +24 -19
- package/dist/test/memory-store.test.js.map +1 -1
- package/dist/test/qf-full-msg.test.js +19 -14
- package/dist/test/qf-full-msg.test.js.map +1 -1
- package/dist/test/repo-full-ascii-msg.test.js +17 -15
- package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
- package/dist/test/repo-full-fixml-msg.test.js +14 -14
- package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
- package/dist/test/session-state.test.js +2 -2
- package/dist/test/session-state.test.js.map +1 -1
- package/dist/test/session.test.js +263 -143
- package/dist/test/session.test.js.map +1 -1
- package/dist/test/view-decode.test.js +2 -1
- package/dist/test/view-decode.test.js.map +1 -1
- package/dist/transport/a-session-msg-factory.d.ts +23 -0
- package/dist/transport/a-session-msg-factory.js +58 -0
- package/dist/transport/a-session-msg-factory.js.map +1 -0
- package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -0
- package/dist/transport/ascii/ascii-msg-transmitter.js +39 -8
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.d.ts +16 -0
- package/dist/transport/ascii/ascii-session-msg-factory.js +47 -0
- package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -0
- package/dist/transport/ascii/ascii-session.d.ts +10 -2
- package/dist/transport/ascii/ascii-session.js +86 -31
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/ascii/index.d.ts +1 -0
- package/dist/transport/ascii/index.js +1 -0
- package/dist/transport/ascii/index.js.map +1 -1
- package/dist/transport/ascii-session-msg-factory.d.ts +16 -0
- package/dist/transport/ascii-session-msg-factory.js +47 -0
- package/dist/transport/ascii-session-msg-factory.js.map +1 -0
- package/dist/transport/duplex/http-duplex.js +2 -2
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/fix-msg-factory.d.ts +1 -1
- package/dist/transport/fix-msg-factory.js.map +1 -1
- package/dist/transport/fix-session-state.d.ts +38 -12
- package/dist/transport/fix-session-state.js +49 -15
- package/dist/transport/fix-session-state.js.map +1 -1
- package/dist/transport/fix-session.d.ts +13 -6
- package/dist/transport/fix-session.js +143 -39
- package/dist/transport/fix-session.js.map +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.d.ts +13 -0
- package/dist/transport/fixml/fixml-session-msg-factory.js +68 -0
- package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -0
- package/dist/transport/fixml/fixml-session.js +1 -1
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/fixml/index.d.ts +2 -1
- package/dist/transport/fixml/index.js +2 -1
- package/dist/transport/fixml/index.js.map +1 -1
- package/dist/transport/fixml-session-msg-factory.d.ts +13 -0
- package/dist/transport/fixml-session-msg-factory.js +68 -0
- package/dist/transport/fixml-session-msg-factory.js.map +1 -0
- package/dist/transport/http/http-acceptor.js +8 -7
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/msg-transmitter.js +4 -3
- package/dist/transport/msg-transmitter.js.map +1 -1
- package/dist/transport/msg-transport.js +3 -2
- package/dist/transport/msg-transport.js.map +1 -1
- package/dist/transport/session-description.d.ts +1 -1
- package/dist/transport/session-description.js.map +1 -1
- package/dist/transport/session-msg-factory.d.ts +2 -2
- package/dist/transport/session-msg-factory.js +2 -2
- package/dist/transport/session-msg-factory.js.map +1 -1
- package/dist/transport/tcp/acceptor.js +5 -3
- package/dist/transport/tcp/acceptor.js.map +1 -1
- package/dist/transport/tcp/index.d.ts +1 -0
- package/dist/transport/tcp/index.js +1 -0
- package/dist/transport/tcp/index.js.map +1 -1
- package/dist/transport/tcp/initiator.js +1 -0
- package/dist/transport/tcp/initiator.js.map +1 -1
- package/dist/transport/tcp/recovering-initiator.d.ts +17 -0
- package/dist/transport/tcp/recovering-initiator.js +30 -0
- package/dist/transport/tcp/recovering-initiator.js.map +1 -0
- package/dist/transport/tcp/recovering-tcp-initiator.d.ts +28 -0
- package/dist/transport/tcp/recovering-tcp-initiator.js +120 -0
- package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -0
- package/dist/transport/tcp/tcp-acceptor.d.ts +7 -0
- package/dist/transport/tcp/tcp-acceptor.js +43 -11
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator.d.ts +4 -0
- package/dist/transport/tcp/tcp-initiator.js +72 -35
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/advertisement.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/advertisement.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_instruction.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_instruction.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_report_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_report_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/assignment_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/assignment_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/bid_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/bid_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/bid_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/bid_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/business_message_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/business_message_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_assignment.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_assignment.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_inquiry.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_inquiry.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/derivative_security_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/derivative_security_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/derivative_security_list_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/derivative_security_list_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/dont_know_trade.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/dont_know_trade.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/email.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/email.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/execution_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/execution_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/heartbeat.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/heartbeat.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/index.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/index.js +4 -0
- package/dist/types/FIX4.4/quickfix/index.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/ioi.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/ioi.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_execute.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_execute.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_strike_price.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_strike_price.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/logon.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/logon.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/logout.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/logout.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_request_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_request_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/mass_quote.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/mass_quote.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_cross.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_cross.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_multileg.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_multileg.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_single.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_single.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/news.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/news.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_maintenance_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_maintenance_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_maintenance_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_maintenance_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_cancel.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_cancel.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_request_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_request_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_status_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_status_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/registration_instructions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/registration_instructions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/registration_instructions_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/registration_instructions_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/request_for_positions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/request_for_positions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/request_for_positions_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/request_for_positions_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/resend_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/resend_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/rfq_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/rfq_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_definition.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_definition.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_definition_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_definition_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_list_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_list_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_type_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_type_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_types.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_types.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/sequence_reset.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/sequence_reset.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/set/header.d.ts +31 -0
- package/dist/types/FIX4.4/quickfix/set/header.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/header.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/hop.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/set/hop.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/hop.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.d.ts +5 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.d.ts +31 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.d.ts +6 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +6 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/settlement_instruction_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/settlement_instruction_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/settlement_instructions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/settlement_instructions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/test_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/test_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trading_session_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trading_session_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trading_session_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trading_session_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/user_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/user_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/user_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/user_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/xm_lnon_fix.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/xm_lnon_fix.js.map +1 -1
- package/dist/types/FIX4.4/repo/enum/all-enum.js.map +1 -1
- package/package.json +25 -21
- package/script/build.sh +1 -0
- package/src/buffer/ascii/ascii-encoder.ts +110 -33
- package/src/buffer/ascii/ascii-parser.ts +8 -1
- package/src/buffer/ascii/ascii-segment-parser.ts +44 -38
- package/src/buffer/ascii/ascii-view.ts +5 -0
- package/src/buffer/ascii/time-formatter.ts +2 -2
- package/src/buffer/ascii-chars.ts +1 -0
- package/src/buffer/elastic-buffer.ts +9 -0
- package/src/buffer/encode-proxy.ts +2 -2
- package/src/buffer/fixml/fixml-encoder.ts +8 -0
- package/src/buffer/fixml/fixml-view.ts +5 -0
- package/src/buffer/msg-encoder.ts +2 -0
- package/src/buffer/msg-view.ts +3 -0
- package/src/buffer/tags.ts +1 -1
- package/src/collections/dictionary.ts +6 -0
- package/src/config/js-fix-config.ts +2 -0
- package/src/dictionary/parser/quickfix/field-set-parser.ts +11 -4
- package/src/dictionary/parser/quickfix/message-parser.ts +4 -0
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +16 -0
- package/src/jsfix-cmd.ts +2 -1
- package/src/sample/http/oms/app.ts +2 -0
- package/src/sample/launcher.ts +17 -7
- package/src/sample/tcp/qf-md/app.ts +26 -0
- package/src/sample/tcp/qf-md/md-client.ts +51 -0
- package/src/sample/tcp/qf-md/md-factory.ts +34 -0
- package/src/sample/tcp/qf-md/md-server.ts +56 -0
- package/src/sample/tcp/recovering-skeleton/app.ts +33 -0
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +41 -0
- package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +54 -0
- package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +60 -0
- package/src/sample/tcp/skeleton/app.ts +2 -0
- package/src/sample/tcp/skeleton/skeleton-session.ts +26 -4
- package/src/sample/tcp/tls-trade-capture/app.ts +1 -1
- package/src/sample/tcp/{trade_capture → trade-capture}/app.ts +0 -0
- package/src/sample/tcp/{trade_capture → trade-capture}/index.ts +0 -0
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.ts +10 -5
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.ts +2 -2
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-factory.ts +0 -0
- package/src/store/fix-msg-ascii-store-resend.ts +87 -0
- package/src/store/fix-msg-memory-store.ts +171 -0
- package/src/store/fix-msg-store-record.ts +23 -0
- package/src/store/fix-msg-store.ts +23 -0
- package/src/store/index.ts +4 -0
- package/src/transport/a-session-msg-factory.ts +81 -0
- package/src/transport/ascii/ascii-msg-transmitter.ts +32 -11
- package/src/transport/ascii/ascii-session-msg-factory.ts +62 -0
- package/src/transport/ascii/ascii-session.ts +100 -36
- package/src/transport/ascii/index.ts +1 -0
- package/src/transport/duplex/http-duplex.ts +2 -2
- package/src/transport/fix-msg-factory.ts +1 -1
- package/src/transport/fix-session-state.ts +67 -15
- package/src/transport/fix-session.ts +156 -43
- package/src/transport/fixml/fixml-session-msg-factory.ts +76 -0
- package/src/transport/fixml/fixml-session.ts +1 -1
- package/src/transport/fixml/index.ts +2 -1
- package/src/transport/http/http-acceptor.ts +7 -6
- package/src/transport/index.ts +1 -1
- package/src/transport/msg-transmitter.ts +4 -3
- package/src/transport/msg-transport.ts +3 -2
- package/src/transport/session-description.ts +1 -1
- package/src/transport/tcp/acceptor.ts +5 -3
- package/src/transport/tcp/index.ts +1 -0
- package/src/transport/tcp/initiator.ts +1 -0
- package/src/transport/tcp/recovering-tcp-initiator.ts +149 -0
- package/src/transport/tcp/tcp-acceptor.ts +46 -11
- package/src/transport/tcp/tcp-initiator.ts +77 -40
- package/src/types/FIX4.4/quickfix/advertisement.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_instruction.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_instruction_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_report_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/assignment_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/bid_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/bid_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/business_message_reject.ts +5 -0
- package/src/types/FIX4.4/quickfix/collateral_assignment.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_inquiry.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_inquiry_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/confirmation.ts +4 -0
- package/src/types/FIX4.4/quickfix/confirmation_ack.ts +5 -0
- package/src/types/FIX4.4/quickfix/confirmation_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/cross_order_cancel_replace_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/cross_order_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/derivative_security_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/derivative_security_list_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/dont_know_trade.ts +4 -0
- package/src/types/FIX4.4/quickfix/email.ts +4 -0
- package/src/types/FIX4.4/quickfix/execution_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/heartbeat.ts +5 -0
- package/src/types/FIX4.4/quickfix/index.ts +4 -0
- package/src/types/FIX4.4/quickfix/ioi.ts +4 -0
- package/src/types/FIX4.4/quickfix/list_cancel_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/list_execute.ts +6 -1
- package/src/types/FIX4.4/quickfix/list_status.ts +4 -0
- package/src/types/FIX4.4/quickfix/list_status_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/list_strike_price.ts +4 -0
- package/src/types/FIX4.4/quickfix/logon.ts +4 -0
- package/src/types/FIX4.4/quickfix/logout.ts +6 -1
- package/src/types/FIX4.4/quickfix/market_data_incremental_refresh.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_request_reject.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.ts +4 -0
- package/src/types/FIX4.4/quickfix/mass_quote.ts +4 -0
- package/src/types/FIX4.4/quickfix/mass_quote_acknowledgement.ts +4 -0
- package/src/types/FIX4.4/quickfix/multileg_order_cancel_replace.ts +4 -0
- package/src/types/FIX4.4/quickfix/network_counterparty_system_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/network_counterparty_system_status_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_cross.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_multileg.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_single.ts +4 -0
- package/src/types/FIX4.4/quickfix/news.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_cancel_reject.ts +5 -0
- package/src/types/FIX4.4/quickfix/order_cancel_replace_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_cancel_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_maintenance_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_maintenance_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_cancel.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_request_reject.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_status_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/registration_instructions.ts +4 -0
- package/src/types/FIX4.4/quickfix/registration_instructions_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/reject.ts +6 -1
- package/src/types/FIX4.4/quickfix/request_for_positions.ts +4 -0
- package/src/types/FIX4.4/quickfix/request_for_positions_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/resend_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/rfq_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_definition.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_definition_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_list_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_status.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_type_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/security_types.ts +4 -0
- package/src/types/FIX4.4/quickfix/sequence_reset.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/hop.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/hop_no_hops.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/standard_header.ts +31 -0
- package/src/types/FIX4.4/quickfix/set/standard_trailer.ts +5 -0
- package/src/types/FIX4.4/quickfix/settlement_instruction_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/settlement_instructions.ts +4 -0
- package/src/types/FIX4.4/quickfix/test_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_request_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/trading_session_status.ts +5 -0
- package/src/types/FIX4.4/quickfix/trading_session_status_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/user_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/user_response.ts +5 -0
- package/src/types/FIX4.4/quickfix/xm_lnon_fix.ts +5 -0
- package/src/types/FIX4.4/repo/enum/all-enum.ts +0 -1
- package/dist/sample/tcp/tls-trade-capture/jsfix.test_client.txt +0 -77
- package/dist/sample/tcp/tls-trade-capture/jsfix.test_server.txt +0 -77
- package/dist/sample/tcp/trade_capture/jsfix.test_client.txt +0 -75
- package/dist/sample/tcp/trade_capture/jsfix.test_server.txt +0 -75
- package/dist/sample/tcp/trade_capture/trade-capture-client.js.map +0 -1
- package/dist/sample/tcp/trade_capture/trade-capture-server.js.map +0 -1
- package/src/transport/session-msg-factory.ts +0 -195
- package/src/transport/tcp/resilient-initiator.ts +0 -35
|
@@ -4,19 +4,20 @@ import { IJsFixConfig } from '../../config'
|
|
|
4
4
|
import { IMsgApplication } from '../session-description'
|
|
5
5
|
import { SessionState, TickAction } from '../fix-session-state'
|
|
6
6
|
import { FixSession } from '../fix-session'
|
|
7
|
+
import { FixMsgAsciiStoreResend, FixMsgMemoryStore, IFixMsgStore, IFixMsgStoreRecord } from '../../store'
|
|
7
8
|
|
|
8
9
|
export abstract class AsciiSession extends FixSession {
|
|
9
10
|
|
|
10
11
|
public heartbeat: boolean = true
|
|
12
|
+
protected store: IFixMsgStore = null
|
|
13
|
+
protected resender: FixMsgAsciiStoreResend
|
|
11
14
|
|
|
12
15
|
protected constructor (public readonly config: IJsFixConfig) {
|
|
13
16
|
super(config)
|
|
14
17
|
this.requestLogoutType = this.respondLogoutType = MsgType.Logout
|
|
15
18
|
this.requestLogonType = MsgType.Logon
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
public static asPiped (txt: string) {
|
|
19
|
-
return txt.replace(/\x01/g,'|')
|
|
19
|
+
this.store = new FixMsgMemoryStore(this.config.description.SenderCompId, this.config)
|
|
20
|
+
this.resender = new FixMsgAsciiStoreResend(this.store, this.config)
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
private checkSeqNo (msgType: string, view: MsgView): boolean {
|
|
@@ -37,14 +38,18 @@ export abstract class AsciiSession extends FixSession {
|
|
|
37
38
|
this.sessionLogger.warning(`terminate as seqDelta (${seqDelta}) < 0 lastSeq = ${lastSeq} seqNo = ${seqNo}`)
|
|
38
39
|
this.stop()
|
|
39
40
|
} else if (seqDelta > 1) {
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
// resend request required as have missed messages.
|
|
42
|
+
|
|
43
|
+
// We process a Logon beforehand to confirm the connection even we out of sync
|
|
44
|
+
if (msgType === MsgType.Logon) {
|
|
45
|
+
this.peerLogon(view)
|
|
46
|
+
}
|
|
47
|
+
// If the out of sync message is a resend request itself, then we handle it first in order
|
|
48
|
+
// to avoid triggering an endless loop of both sides sending resend requests in response to resend requests.
|
|
49
|
+
if (msgType === MsgType.ResendRequest) {
|
|
50
|
+
this.onResendRequest(view)
|
|
47
51
|
}
|
|
52
|
+
this.sendResendRequest(lastSeq, seqNo)
|
|
48
53
|
} else {
|
|
49
54
|
ret = true
|
|
50
55
|
state.lastPeerMsgSeqNum = seqNo
|
|
@@ -54,6 +59,17 @@ export abstract class AsciiSession extends FixSession {
|
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|
|
62
|
+
protected checkForwardMsg (msgType: string, view: MsgView): void {
|
|
63
|
+
const okToForward = this.validStateApplicationMsg()
|
|
64
|
+
if (okToForward) {
|
|
65
|
+
this.sessionLogger.info(`ascii forwarding msgType = '${msgType}' to application`)
|
|
66
|
+
this.setState(SessionState.ActiveNormalSession)
|
|
67
|
+
this.onApplicationMsg(msgType, view)
|
|
68
|
+
} else {
|
|
69
|
+
this.terminate(new Error(`msgType ${msgType} received in state ${this.stateString()}`))
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
57
73
|
private sendReject (msgType: string, seqNo: number, msg: string, reason: number): void {
|
|
58
74
|
const factory = this.config.factory
|
|
59
75
|
const reject = factory.reject(msgType, seqNo, msg, reason)
|
|
@@ -61,6 +77,12 @@ export abstract class AsciiSession extends FixSession {
|
|
|
61
77
|
this.send(MsgType.Reject, reject)
|
|
62
78
|
}
|
|
63
79
|
|
|
80
|
+
protected sendResendRequest (lastSeq: number, receivedSeq: number) {
|
|
81
|
+
const resend = this.config.factory.resendRequest(lastSeq + 1, 0)
|
|
82
|
+
this.sessionLogger.warning(`received seq ${receivedSeq}, but last known seq is ${lastSeq}. Sending resend request for all messages > ${lastSeq}`)
|
|
83
|
+
this.send(MsgType.ResendRequest, resend)
|
|
84
|
+
}
|
|
85
|
+
|
|
64
86
|
private checkIntegrity (msgType: string, view: MsgView): boolean {
|
|
65
87
|
const state = this.sessionState
|
|
66
88
|
const seqNum = view.getTyped(MsgTag.MsgSeqNum)
|
|
@@ -101,7 +123,8 @@ export abstract class AsciiSession extends FixSession {
|
|
|
101
123
|
}
|
|
102
124
|
|
|
103
125
|
switch (state.state) {
|
|
104
|
-
case SessionState.
|
|
126
|
+
case SessionState.InitiationLogonReceived:
|
|
127
|
+
case SessionState.InitiationLogonResponse: {
|
|
105
128
|
const targetCompId = view.getString(MsgTag.TargetCompID)
|
|
106
129
|
if (targetCompId !== state.compId) {
|
|
107
130
|
const msg: string = `msgType ${msgType} unexpected TargetCompID ${targetCompId}`
|
|
@@ -130,21 +153,44 @@ export abstract class AsciiSession extends FixSession {
|
|
|
130
153
|
* Override to resend stored messages following a sequence reset.
|
|
131
154
|
* @protected
|
|
132
155
|
*/
|
|
133
|
-
// tslint:disable-next-line:no-empty
|
|
134
156
|
protected onResendRequest (view: MsgView) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
// if no records are in store then send a gap fill for entire sequence
|
|
158
|
+
this.setState(SessionState.HandleResendRequest)
|
|
159
|
+
const [beginSeqNo, endSeqNo] = view.getTypedTags([MsgTag.BeginSeqNo, MsgTag.EndSeqNo])
|
|
160
|
+
this.sessionLogger.info(`onResendRequest getResendRequest beginSeqNo = ${beginSeqNo}, endSeqNo = ${endSeqNo}`)
|
|
161
|
+
this.resender.getResendRequest(beginSeqNo, endSeqNo).then((records: IFixMsgStoreRecord[]) => {
|
|
162
|
+
const validRecords = records.filter(rec => rec.obj !== null)
|
|
163
|
+
this.sessionLogger.info(`sending ${validRecords.length}`)
|
|
164
|
+
validRecords.forEach(rec => {
|
|
165
|
+
this.send(rec.msgType, rec.obj)
|
|
166
|
+
})
|
|
167
|
+
this.setState(SessionState.ActiveNormalSession)
|
|
168
|
+
}).catch(e => {
|
|
169
|
+
this.sessionLogger.error(e)
|
|
170
|
+
})
|
|
138
171
|
}
|
|
139
172
|
|
|
140
|
-
|
|
173
|
+
okForLogon (): boolean {
|
|
174
|
+
const state = this.sessionState.state
|
|
175
|
+
if (this.acceptor) {
|
|
176
|
+
return state === SessionState.WaitingForALogon
|
|
177
|
+
}
|
|
178
|
+
return state === SessionState.InitiationLogonSent
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
protected onSessionMsg (msgType: string, view: MsgView): void {
|
|
141
182
|
|
|
142
|
-
const factory = this.config.factory
|
|
143
183
|
const logger = this.sessionLogger
|
|
144
184
|
|
|
145
185
|
switch (msgType) {
|
|
146
186
|
case MsgType.Logon: {
|
|
147
|
-
|
|
187
|
+
// only valid to receive a logon when in LogonSent or WaitingALogon
|
|
188
|
+
// else will drop connection immediately.
|
|
189
|
+
if (this.okForLogon()) {
|
|
190
|
+
this.peerLogon(view)
|
|
191
|
+
} else {
|
|
192
|
+
this.terminate(new Error(`state ${this.stateString()} is illegal for Logon`))
|
|
193
|
+
}
|
|
148
194
|
break
|
|
149
195
|
}
|
|
150
196
|
|
|
@@ -155,17 +201,18 @@ export abstract class AsciiSession extends FixSession {
|
|
|
155
201
|
|
|
156
202
|
case MsgType.TestRequest: {
|
|
157
203
|
const req: string = view.getString(MsgTag.TestReqID)
|
|
158
|
-
this.
|
|
204
|
+
this.sendHeartbeat(req)
|
|
159
205
|
break
|
|
160
206
|
}
|
|
161
207
|
|
|
162
208
|
case MsgType.Heartbeat: {
|
|
163
209
|
this.sessionState.lastTestRequestAt = null
|
|
210
|
+
this.setState(SessionState.ActiveNormalSession)
|
|
164
211
|
break
|
|
165
212
|
}
|
|
166
213
|
|
|
167
214
|
case MsgType.ResendRequest: {
|
|
168
|
-
logger.info(`peer sends '${msgType}' resend
|
|
215
|
+
logger.info(`peer sends '${msgType}' resend request.`)
|
|
169
216
|
this.onResendRequest(view)
|
|
170
217
|
break
|
|
171
218
|
}
|
|
@@ -196,10 +243,8 @@ export abstract class AsciiSession extends FixSession {
|
|
|
196
243
|
this.sessionLogger.info(`message '${msgType}' failed checkIntegrity.`)
|
|
197
244
|
switch (msgType) {
|
|
198
245
|
case MsgType.Logon: {
|
|
199
|
-
this.
|
|
200
|
-
this.
|
|
201
|
-
this.tick()
|
|
202
|
-
}, 200)
|
|
246
|
+
this.setState(SessionState.PeerLogonRejected)
|
|
247
|
+
this.startTimer()
|
|
203
248
|
break
|
|
204
249
|
}
|
|
205
250
|
}
|
|
@@ -225,34 +270,53 @@ export abstract class AsciiSession extends FixSession {
|
|
|
225
270
|
}
|
|
226
271
|
}
|
|
227
272
|
|
|
273
|
+
private startTimer (interval: number = 200) {
|
|
274
|
+
this.timer = setInterval(() => {
|
|
275
|
+
this.tick()
|
|
276
|
+
}, interval)
|
|
277
|
+
}
|
|
278
|
+
|
|
228
279
|
private peerLogon (view: MsgView) {
|
|
229
280
|
const logger = this.sessionLogger
|
|
230
|
-
const heartBtInt = view.
|
|
231
|
-
const peerCompId = view.getTyped(MsgTag.SenderCompID)
|
|
232
|
-
const userName = view.getString(MsgTag.Username)
|
|
281
|
+
const [heartBtInt, peerCompId, userName, password] = view.getTypedTags([MsgTag.HeartBtInt, MsgTag.SenderCompID, MsgTag.Username, MsgTag.Password])
|
|
233
282
|
logger.info(`peerLogon Username = ${userName}, heartBtInt = ${heartBtInt}, peerCompId = ${peerCompId}, userName = ${userName}`)
|
|
234
283
|
const state = this.sessionState
|
|
235
|
-
state.state = SessionState.PeerLoggedOn
|
|
236
284
|
state.peerHeartBeatSecs = view.getTyped(MsgTag.HeartBtInt)
|
|
237
285
|
state.peerCompId = view.getTyped(MsgTag.SenderCompID)
|
|
286
|
+
const res = this.onLogon(view, userName, password)
|
|
287
|
+
// currently not using this.
|
|
288
|
+
logger.info(`peerLogon onLogon returns ${res}`)
|
|
238
289
|
if (this.acceptor) {
|
|
239
|
-
this.
|
|
290
|
+
this.setState(SessionState.InitiationLogonResponse)
|
|
291
|
+
logger.info('acceptor responds to logon request')
|
|
292
|
+
this.sendLogon() // if res send response else reject, terminate
|
|
293
|
+
} else { // as an initiator the acceptor has responded
|
|
294
|
+
logger.info('initiator receives logon response')
|
|
295
|
+
this.setState(SessionState.InitiationLogonReceived)
|
|
240
296
|
}
|
|
241
297
|
if (this.heartbeat) {
|
|
242
298
|
logger.debug(`start heartbeat timer.`)
|
|
243
|
-
this.
|
|
244
|
-
this.tick()
|
|
245
|
-
}, 200)
|
|
299
|
+
this.startTimer()
|
|
246
300
|
}
|
|
247
301
|
logger.info(`system ready, inform app`)
|
|
248
302
|
this.onReady(view)
|
|
249
303
|
}
|
|
250
304
|
|
|
305
|
+
private sendTestRequest () {
|
|
306
|
+
const factory = this.config.factory
|
|
307
|
+
this.setState(SessionState.AwaitingProcessingResponseToTestRequest)
|
|
308
|
+
this.send(MsgType.TestRequest, factory.testRequest())
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
private sendHeartbeat (testReqId: string) {
|
|
312
|
+
const factory = this.config.factory
|
|
313
|
+
this.send(MsgType.Heartbeat, factory.heartbeat(testReqId))
|
|
314
|
+
}
|
|
315
|
+
|
|
251
316
|
private tick (): void {
|
|
252
317
|
const sessionState = this.sessionState
|
|
253
318
|
const action: TickAction = sessionState.calcAction(new Date())
|
|
254
319
|
const application: IMsgApplication = this.transport.config.description.application
|
|
255
|
-
const factory = this.config.factory
|
|
256
320
|
const logger = this.sessionLogger
|
|
257
321
|
|
|
258
322
|
switch (action) {
|
|
@@ -263,13 +327,13 @@ export abstract class AsciiSession extends FixSession {
|
|
|
263
327
|
|
|
264
328
|
case TickAction.TestRequest: {
|
|
265
329
|
logger.debug(`send test req. state = ${sessionState.toString()}`)
|
|
266
|
-
this.
|
|
330
|
+
this.sendTestRequest()
|
|
267
331
|
break
|
|
268
332
|
}
|
|
269
333
|
|
|
270
334
|
case TickAction.Heartbeat: {
|
|
271
335
|
logger.debug(`send heartbeat. state = ${sessionState.toString()}`)
|
|
272
|
-
this.
|
|
336
|
+
this.sendHeartbeat(sessionState.now.toUTCString())
|
|
273
337
|
break
|
|
274
338
|
}
|
|
275
339
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FixDuplex } from './fix-duplex'
|
|
2
2
|
import { Readable, Writable } from 'stream'
|
|
3
3
|
import { IHttpAdapter } from '../session-description'
|
|
4
|
-
import * as
|
|
4
|
+
import * as rp from 'request-promise-native'
|
|
5
5
|
|
|
6
6
|
export class HttpDuplex extends FixDuplex {
|
|
7
7
|
public constructor (public readonly adapter: IHttpAdapter) {
|
|
@@ -28,7 +28,7 @@ export class HttpDuplex extends FixDuplex {
|
|
|
28
28
|
try {
|
|
29
29
|
const adapter = this.adapter
|
|
30
30
|
const options = adapter.getOptions(data)
|
|
31
|
-
|
|
31
|
+
rp(options).then((message: any) => {
|
|
32
32
|
const body = adapter.endMessage(message)
|
|
33
33
|
forward.push(body)
|
|
34
34
|
done()
|
|
@@ -9,7 +9,7 @@ export interface ISessionMsgFactory {
|
|
|
9
9
|
logon (userRequestId?: string, isResponse?: boolean): ILooseObject
|
|
10
10
|
testRequest (reqId?: string): ILooseObject
|
|
11
11
|
resendRequest (from: number, to: number): ILooseObject
|
|
12
|
-
sequenceReset (newSeq: number): ILooseObject
|
|
12
|
+
sequenceReset (newSeq: number, gapFill?: boolean): ILooseObject
|
|
13
13
|
heartbeat (testReqId: string): ILooseObject
|
|
14
14
|
header (msgType?: string, seqNum?: number, time?: Date, overrideData?: Partial<IStandardHeader>): ILooseObject
|
|
15
15
|
trailer (checksum: number): ILooseObject
|
|
@@ -2,12 +2,29 @@ import { ElasticBuffer } from '../buffer'
|
|
|
2
2
|
import moment = require('moment')
|
|
3
3
|
|
|
4
4
|
export enum SessionState {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
DisconnectedNoConnectionToday = 1,
|
|
6
|
+
DisconnectedConnectionToday = 2,
|
|
7
|
+
DetectBrokenNetworkConnection = 3,
|
|
8
|
+
AwaitingConnection = 4,
|
|
9
|
+
InitiateConnection = 5,
|
|
10
|
+
NetworkConnectionEstablished = 6,
|
|
11
|
+
InitiationLogonSent = 7,
|
|
12
|
+
InitiationLogonReceived = 8,
|
|
13
|
+
InitiationLogonResponse = 9,
|
|
14
|
+
HandleResendRequest = 10,
|
|
15
|
+
ReceiveMsgSeqNumTooHigh = 11,
|
|
16
|
+
AwaitingProcessingResponseToResendRequest = 12,
|
|
17
|
+
NoMessagesReceivedInInterval = 13,
|
|
18
|
+
AwaitingProcessingResponseToTestRequest = 14,
|
|
19
|
+
ReceiveLogout = 15,
|
|
20
|
+
InitiateLogout = 16,
|
|
21
|
+
ActiveNormalSession = 17,
|
|
22
|
+
WaitingForALogon = 18,
|
|
23
|
+
PeerLogonRejected = 20,
|
|
24
|
+
WaitingLogoutConfirm = 21,
|
|
25
|
+
ConfirmingLogout = 22,
|
|
26
|
+
Stopped = 23,
|
|
27
|
+
Idle = 24
|
|
11
28
|
}
|
|
12
29
|
|
|
13
30
|
export enum TickAction {
|
|
@@ -19,6 +36,14 @@ export enum TickAction {
|
|
|
19
36
|
Stop = 6
|
|
20
37
|
}
|
|
21
38
|
|
|
39
|
+
interface IFixSessionStateArgs {
|
|
40
|
+
heartBeat: number
|
|
41
|
+
state?: SessionState
|
|
42
|
+
waitLogoutConfirmSeconds?: number
|
|
43
|
+
stopSeconds?: number
|
|
44
|
+
lastPeerMsgSeqNum?: number
|
|
45
|
+
}
|
|
46
|
+
|
|
22
47
|
export class FixSessionState {
|
|
23
48
|
public nextTickAction: TickAction = TickAction.Nothing
|
|
24
49
|
|
|
@@ -30,17 +55,41 @@ export class FixSessionState {
|
|
|
30
55
|
public compId: string = ''
|
|
31
56
|
public peerCompId: string = ''
|
|
32
57
|
public peerHeartBeatSecs: number = 0
|
|
58
|
+
public lastPeerMsgSeqNum: number
|
|
59
|
+
public readonly heartBeat: number
|
|
60
|
+
public state: SessionState
|
|
61
|
+
public readonly waitLogoutConfirmSeconds: number
|
|
62
|
+
public readonly stopSeconds: number
|
|
33
63
|
|
|
34
64
|
private secondsSinceLogoutSent: number = -1
|
|
35
65
|
private secondsSinceSent: number = -1
|
|
36
66
|
private secondsSinceReceive: number = -1
|
|
37
67
|
|
|
38
|
-
public
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
68
|
+
public reset (resetSeqNo: boolean): void {
|
|
69
|
+
this.lastReceivedAt = null
|
|
70
|
+
this.LastSentAt = null
|
|
71
|
+
this.lastTestRequestAt = null
|
|
72
|
+
this.secondsSinceLogoutSent = -1
|
|
73
|
+
this.secondsSinceSent = -1
|
|
74
|
+
this.secondsSinceReceive = -1
|
|
75
|
+
this.peerHeartBeatSecs = 0
|
|
76
|
+
this.logoutSentAt = null
|
|
77
|
+
this.nextTickAction = TickAction.Nothing
|
|
78
|
+
if (resetSeqNo) {
|
|
79
|
+
this.lastPeerMsgSeqNum = 0
|
|
80
|
+
}
|
|
81
|
+
}
|
|
43
82
|
|
|
83
|
+
public constructor ({ heartBeat,
|
|
84
|
+
state = SessionState.Idle,
|
|
85
|
+
waitLogoutConfirmSeconds = 5,
|
|
86
|
+
stopSeconds = 2,
|
|
87
|
+
lastPeerMsgSeqNum = 0 }: IFixSessionStateArgs) {
|
|
88
|
+
this.heartBeat = heartBeat
|
|
89
|
+
this.state = state
|
|
90
|
+
this.waitLogoutConfirmSeconds = waitLogoutConfirmSeconds
|
|
91
|
+
this.stopSeconds = stopSeconds
|
|
92
|
+
this.lastPeerMsgSeqNum = lastPeerMsgSeqNum
|
|
44
93
|
}
|
|
45
94
|
|
|
46
95
|
private static dateAsString (d: Date) {
|
|
@@ -56,8 +105,8 @@ export class FixSessionState {
|
|
|
56
105
|
|
|
57
106
|
buffer.writeString(`compId = ${this.compId}, `)
|
|
58
107
|
buffer.writeString(`heartBeat = ${this.heartBeat}, `)
|
|
59
|
-
buffer.writeString(`state = ${this.state}, `)
|
|
60
|
-
buffer.writeString(`nextTickAction = ${this.nextTickAction}, `)
|
|
108
|
+
buffer.writeString(`state = ${SessionState[this.state]} (${this.state}), `)
|
|
109
|
+
buffer.writeString(`nextTickAction = ${TickAction[this.nextTickAction]} (${this.nextTickAction}), `)
|
|
61
110
|
buffer.writeString(`now = ${FixSessionState.dateAsString(this.now)}, `)
|
|
62
111
|
buffer.writeString(`timeToDie = ${this.timeToDie()}, `)
|
|
63
112
|
buffer.writeString(`timeToHeartbeat = ${this.timeToHeartbeat()}, `)
|
|
@@ -98,7 +147,10 @@ export class FixSessionState {
|
|
|
98
147
|
break
|
|
99
148
|
}
|
|
100
149
|
|
|
101
|
-
case SessionState.
|
|
150
|
+
case SessionState.ActiveNormalSession:
|
|
151
|
+
case SessionState.AwaitingProcessingResponseToTestRequest:
|
|
152
|
+
case SessionState.InitiationLogonReceived:
|
|
153
|
+
case SessionState.InitiationLogonResponse : {
|
|
102
154
|
if (this.timeToHeartbeat()) {
|
|
103
155
|
// have not sent anything for heartbeat period so let other side know still alive.
|
|
104
156
|
this.nextTickAction = TickAction.Heartbeat
|
|
@@ -123,7 +175,7 @@ export class FixSessionState {
|
|
|
123
175
|
|
|
124
176
|
public timeToDie (): boolean {
|
|
125
177
|
return this.secondsSinceLogoutSent > this.waitLogoutConfirmSeconds ||
|
|
126
|
-
|
|
178
|
+
this.secondsSinceLogoutSent > this.stopSeconds
|
|
127
179
|
}
|
|
128
180
|
|
|
129
181
|
public timeToHeartbeat (): boolean {
|