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
|
@@ -51,6 +51,12 @@ export class Dictionary<T> {
|
|
|
51
51
|
return this.container[key]
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
public clear () {
|
|
55
|
+
this.keys().forEach(k => {
|
|
56
|
+
this.remove(k)
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
public forEach (cb: IDictIteratorCb<T>): void {
|
|
55
61
|
Object.keys(this.container).forEach((k: string) => cb(k, this.container[k]))
|
|
56
62
|
}
|
|
@@ -9,10 +9,12 @@ export interface IJsFixConfig {
|
|
|
9
9
|
definitions: FixDefinitions
|
|
10
10
|
description: ISessionDescription
|
|
11
11
|
delimiter?: number
|
|
12
|
+
logDelimiter?: number
|
|
12
13
|
logFactory: JsFixLoggerFactory
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export class JsFixConfig implements IJsFixConfig {
|
|
17
|
+
public logDelimiter: number = AsciiChars.Pipe
|
|
16
18
|
constructor (
|
|
17
19
|
public readonly factory: ISessionMsgFactory,
|
|
18
20
|
public readonly definitions: FixDefinitions,
|
|
@@ -15,13 +15,20 @@ export class FieldSetParser extends NodeParser {
|
|
|
15
15
|
case 'header':
|
|
16
16
|
case 'trailer': {
|
|
17
17
|
const componentName: string = node.attributes.name || node.name
|
|
18
|
+
let fullName = componentName
|
|
19
|
+
if (componentName === 'header') {
|
|
20
|
+
fullName = 'StandardHeader'
|
|
21
|
+
} else if (componentName === 'trailer') {
|
|
22
|
+
fullName = 'StandardTrailer'
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
if (!node.isSelfClosing) {
|
|
19
|
-
const set: ComponentFieldDefinition = new ComponentFieldDefinition(
|
|
20
|
-
const context: ParseContext = new ParseContext(
|
|
26
|
+
const set: ComponentFieldDefinition = new ComponentFieldDefinition(fullName, componentName, null, null)
|
|
27
|
+
const context: ParseContext = new ParseContext(fullName, true, set)
|
|
21
28
|
this.parseContexts.push(context)
|
|
22
29
|
} else {
|
|
23
|
-
this.addComponentField(
|
|
24
|
-
const context: ParseContext = new ParseContext(
|
|
30
|
+
this.addComponentField(fullName, node)
|
|
31
|
+
const context: ParseContext = new ParseContext(fullName, false, null)
|
|
25
32
|
this.parseContexts.push(context)
|
|
26
33
|
}
|
|
27
34
|
break
|
|
@@ -3,6 +3,7 @@ import { MessageDefinition } from '../../definition'
|
|
|
3
3
|
import { NodeParser } from './node-parser'
|
|
4
4
|
import { ParseContext } from './parse-context'
|
|
5
5
|
import { QuickFixXmlFileParser } from './quick-fix-xml-file-parser'
|
|
6
|
+
import { ContainedComponentField } from '../../contained'
|
|
6
7
|
|
|
7
8
|
export class MessageParser extends NodeParser {
|
|
8
9
|
|
|
@@ -16,6 +17,9 @@ export class MessageParser extends NodeParser {
|
|
|
16
17
|
const att: any = node.attributes
|
|
17
18
|
const msg: MessageDefinition = new MessageDefinition(att.name, att.name, att.msgtype, att.msgcat, null)
|
|
18
19
|
const context: ParseContext = new ParseContext(msg.name, true, msg)
|
|
20
|
+
const hdr = this.definitions.component.get('StandardHeader')
|
|
21
|
+
const contained = new ContainedComponentField(hdr, msg.fields.length, true)
|
|
22
|
+
msg.add(contained)
|
|
19
23
|
this.parseContexts.push(context)
|
|
20
24
|
break
|
|
21
25
|
}
|
|
@@ -10,6 +10,7 @@ import { FixParser } from '../../fix-parser'
|
|
|
10
10
|
import { FixDefinitionSource, VersionUtil } from '../../fix-versions'
|
|
11
11
|
import { GetJsFixLogger } from '../../../config'
|
|
12
12
|
import { promisify } from 'util'
|
|
13
|
+
import { ContainedComponentField } from '../../contained'
|
|
13
14
|
|
|
14
15
|
enum ParseState {
|
|
15
16
|
Begin = 1,
|
|
@@ -185,6 +186,20 @@ export class QuickFixXmlFileParser extends FixParser {
|
|
|
185
186
|
})
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
private encloseMessages (): void {
|
|
190
|
+
const messages = this.definitions.message
|
|
191
|
+
const keys = messages.keys()
|
|
192
|
+
const trailerName = 'StandardTrailer'
|
|
193
|
+
keys.forEach(k => {
|
|
194
|
+
const message = messages.get(k)
|
|
195
|
+
const trailer = this.definitions.component.get(trailerName)
|
|
196
|
+
if (trailer && !message.components.containsKey(trailerName)) {
|
|
197
|
+
const contained = new ContainedComponentField(trailer, message.fields.length, true)
|
|
198
|
+
message.add(contained)
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
|
|
188
203
|
public parse (): Promise<FixDefinitions> {
|
|
189
204
|
return new Promise<FixDefinitions>(async (accept, reject) => {
|
|
190
205
|
try {
|
|
@@ -193,6 +208,7 @@ export class QuickFixXmlFileParser extends FixParser {
|
|
|
193
208
|
await this.onePass() // second pass of components top level with forward references replace
|
|
194
209
|
await this.onePass() // third pass of components all fully resolved i.e. pick up versions from pass above
|
|
195
210
|
await this.onePass() // lastly messages with all dependencies
|
|
211
|
+
this.encloseMessages()
|
|
196
212
|
accept(this.definitions)
|
|
197
213
|
} catch (e) {
|
|
198
214
|
reject(e)
|
package/src/jsfix-cmd.ts
CHANGED
|
@@ -447,9 +447,10 @@ export class JsfixCmd {
|
|
|
447
447
|
if (err) {
|
|
448
448
|
reject(err)
|
|
449
449
|
}
|
|
450
|
+
const toParse = new StringDuplex(contents.repeat(repeats), false)
|
|
450
451
|
const startsAt: Date = new Date()
|
|
451
452
|
let i = 0
|
|
452
|
-
const asciiParser: MsgParser = new AsciiParser(definitions,
|
|
453
|
+
const asciiParser: MsgParser = new AsciiParser(definitions, toParse.readable, delimiter)
|
|
453
454
|
asciiParser.on('msg', (msgType: string, v: MsgView) => {
|
|
454
455
|
++i
|
|
455
456
|
if (i === repeats) {
|
package/src/sample/launcher.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as path from 'path'
|
|
2
2
|
import { WinstonLogger, IJsFixConfig, JsFixWinstonLogFactory, IJsFixLogger } from '../config'
|
|
3
|
-
import {
|
|
3
|
+
import { makeConfig, ISessionDescription, ISessionMsgFactory } from '../transport'
|
|
4
|
+
import { AsciiSessionMsgFactory } from '../transport/ascii'
|
|
5
|
+
import { FixmlSessionMsgFactory } from '../transport/fixml'
|
|
4
6
|
|
|
5
7
|
const root = '../../'
|
|
6
8
|
const logFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))
|
|
7
9
|
|
|
8
10
|
export abstract class Launcher {
|
|
9
|
-
|
|
11
|
+
protected readonly logger: IJsFixLogger
|
|
10
12
|
protected constructor (public readonly initiatorConfig: string, public readonly acceptorConfig: string) {
|
|
11
13
|
this.logger = logFactory.logger('launcher')
|
|
12
14
|
}
|
|
@@ -28,14 +30,22 @@ export abstract class Launcher {
|
|
|
28
30
|
})
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
private makeSessionFactory (description: ISessionDescription): ISessionMsgFactory {
|
|
34
|
+
const fixml = description.application.protocol !== 'ascii'
|
|
35
|
+
const factory = fixml ?
|
|
36
|
+
new FixmlSessionMsgFactory(description) :
|
|
37
|
+
new AsciiSessionMsgFactory(description)
|
|
38
|
+
return factory
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
private async setup () {
|
|
32
|
-
const clientDescription = require(path.join(root, this.initiatorConfig))
|
|
33
|
-
const serverDescription = require(path.join(root, this.acceptorConfig))
|
|
34
|
-
this.logger.info(
|
|
42
|
+
const clientDescription: ISessionDescription = require(path.join(root, this.initiatorConfig))
|
|
43
|
+
const serverDescription: ISessionDescription = require(path.join(root, this.acceptorConfig))
|
|
44
|
+
this.logger.info(`launching [protocol ${clientDescription.application.protocol}] ...`)
|
|
35
45
|
const clientConfig = await
|
|
36
|
-
makeConfig(clientDescription, logFactory,
|
|
46
|
+
makeConfig(clientDescription, logFactory, this.makeSessionFactory(clientDescription))
|
|
37
47
|
const serverConfig = await
|
|
38
|
-
makeConfig(serverDescription, logFactory,
|
|
48
|
+
makeConfig(serverDescription, logFactory, this.makeSessionFactory(serverDescription))
|
|
39
49
|
this.logger.info('create acceptor')
|
|
40
50
|
const server = this.getAcceptor(serverConfig)
|
|
41
51
|
this.logger.info('create initiator')
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MDClient } from './md-client'
|
|
2
|
+
import { MDServer } from './md-server'
|
|
3
|
+
import { IJsFixConfig } from '../../../config'
|
|
4
|
+
import { initiator, acceptor } from '../../../transport'
|
|
5
|
+
import { Launcher } from '../../launcher'
|
|
6
|
+
|
|
7
|
+
class AppLauncher extends Launcher {
|
|
8
|
+
public constructor () {
|
|
9
|
+
super(
|
|
10
|
+
'data/session/test-qf44-initiator.json',
|
|
11
|
+
'data/session/test-qf44-acceptor.json')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
protected getAcceptor (config: IJsFixConfig): Promise<any> {
|
|
15
|
+
return acceptor(config, c => new MDServer(c))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
protected getInitiator (config: IJsFixConfig): Promise<any> {
|
|
19
|
+
return initiator(config, c => new MDClient(c))
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const l = new AppLauncher()
|
|
24
|
+
l.run().then(() => {
|
|
25
|
+
console.log('finished.')
|
|
26
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MsgView } from '../../../buffer'
|
|
2
|
+
import { AsciiSession } from '../../../transport'
|
|
3
|
+
import { MsgType } from '../../../types'
|
|
4
|
+
import { IJsFixLogger, IJsFixConfig } from '../../../config'
|
|
5
|
+
|
|
6
|
+
import { MDFactory } from './md-factory'
|
|
7
|
+
|
|
8
|
+
export class MDClient extends AsciiSession {
|
|
9
|
+
private readonly logger: IJsFixLogger
|
|
10
|
+
private readonly fixLog: IJsFixLogger
|
|
11
|
+
|
|
12
|
+
constructor (public readonly config: IJsFixConfig) {
|
|
13
|
+
super(config)
|
|
14
|
+
this.logReceivedMsgs = true
|
|
15
|
+
this.fixLog = config.logFactory.plain(`jsfix.${config!.description!.application!.name}.txt`)
|
|
16
|
+
this.logger = config.logFactory.logger(`${this.me}:MDClient`)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected onApplicationMsg (msgType: string, view: MsgView): void {
|
|
20
|
+
this.logger.info(`${view.toJson()}`)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
protected onStopped (): void {
|
|
24
|
+
this.logger.info('stopped')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// use msgType for example to persist only trade capture messages to database
|
|
28
|
+
protected onDecoded (msgType: string, txt: string): void {
|
|
29
|
+
this.fixLog.info(txt)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// delimiter substitution now done in encoding
|
|
33
|
+
protected onEncoded (msgType: string, txt: string): void {
|
|
34
|
+
this.fixLog.info(txt)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected onReady (view: MsgView): void {
|
|
38
|
+
this.logger.info('ready')
|
|
39
|
+
const logoutSeconds = 32
|
|
40
|
+
this.logger.info(`will logout after ${logoutSeconds}`)
|
|
41
|
+
const mdr = MDFactory.BidOfferRequest('EUR/USD')
|
|
42
|
+
this.send(MsgType.MarketDataRequest, mdr)
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
this.done()
|
|
45
|
+
}, logoutSeconds * 1000)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
49
|
+
return true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IMarketDataRequest,
|
|
3
|
+
MDEntryType,
|
|
4
|
+
SubscriptionRequestType } from '../../../types/FIX4.4/quickfix'
|
|
5
|
+
|
|
6
|
+
export class MDFactory {
|
|
7
|
+
public static BidOfferRequest (symbol: string) {
|
|
8
|
+
return {
|
|
9
|
+
MDReqID: '1',
|
|
10
|
+
SubscriptionRequestType: SubscriptionRequestType.SnapshotPlusUpdates,
|
|
11
|
+
MarketDepth: 0,
|
|
12
|
+
MDReqGrp: {
|
|
13
|
+
NoMDEntryTypes: [
|
|
14
|
+
{
|
|
15
|
+
MDEntryType: MDEntryType.Bid
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
MDEntryType: MDEntryType.Offer
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
InstrmtMDReqGrp: {
|
|
23
|
+
NoRelatedSym: [
|
|
24
|
+
{
|
|
25
|
+
Instrument: {
|
|
26
|
+
StrikeCurrency: 'USD',
|
|
27
|
+
Symbol: symbol
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
} as IMarketDataRequest
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MsgView } from '../../../buffer'
|
|
2
|
+
import { AsciiSession } from '../../../transport'
|
|
3
|
+
import { MsgType } from '../../../types'
|
|
4
|
+
import { IJsFixLogger, IJsFixConfig } from '../../../config'
|
|
5
|
+
import { IMarketDataRequest } from '../../../types/FIX4.4/quickfix'
|
|
6
|
+
|
|
7
|
+
// interfaces generated by compiler to make messages easy in an IDE
|
|
8
|
+
|
|
9
|
+
export class MDServer extends AsciiSession {
|
|
10
|
+
private readonly logger: IJsFixLogger
|
|
11
|
+
private readonly fixLog: IJsFixLogger
|
|
12
|
+
private timerHandle: NodeJS.Timer = null
|
|
13
|
+
|
|
14
|
+
constructor (public readonly config: IJsFixConfig) {
|
|
15
|
+
super(config)
|
|
16
|
+
this.logReceivedMsgs = true
|
|
17
|
+
this.logger = config.logFactory.logger(`${this.me}:MDServer`)
|
|
18
|
+
this.fixLog = config.logFactory.plain(`jsfix.${config!.description!.application!.name}.txt`)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected onApplicationMsg (msgType: string, view: MsgView): void {
|
|
22
|
+
this.logger.info(`${view.toJson()}`)
|
|
23
|
+
switch (msgType) {
|
|
24
|
+
case MsgType.MarketDataRequest: {
|
|
25
|
+
const req: IMarketDataRequest = view.toObject()
|
|
26
|
+
break
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
protected onReady (view: MsgView): void {
|
|
32
|
+
// server waits for client to make a request
|
|
33
|
+
this.logger.info('ready for requests.')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
protected onStopped (): void {
|
|
37
|
+
this.logger.info('stopped')
|
|
38
|
+
if (this.timerHandle) {
|
|
39
|
+
clearInterval(this.timerHandle)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
44
|
+
return true
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// use msgType for example to persist only trade capture messages to database
|
|
48
|
+
protected onDecoded (msgType: string, txt: string): void {
|
|
49
|
+
this.fixLog.info(txt)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// delimiter substitution now done in encoding
|
|
53
|
+
protected onEncoded (msgType: string, txt: string): void {
|
|
54
|
+
this.fixLog.info(txt)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IJsFixConfig } from '../../../config'
|
|
2
|
+
import { Launcher } from '../../launcher'
|
|
3
|
+
import { SkeletonClient } from './skeleton-client'
|
|
4
|
+
import { RecoveringTcpInitiator } from '../../../transport/tcp/recovering-tcp-initiator'
|
|
5
|
+
import { RespawnAcceptor } from './respawn-acceptor'
|
|
6
|
+
import { AsciiChars } from '../../../buffer'
|
|
7
|
+
|
|
8
|
+
class AppLauncher extends Launcher {
|
|
9
|
+
|
|
10
|
+
public constructor () {
|
|
11
|
+
super(
|
|
12
|
+
'data/session/test-initiator.json',
|
|
13
|
+
'data/session/test-acceptor.json')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
protected getAcceptor (config: IJsFixConfig): Promise<any> {
|
|
17
|
+
// use a different log delimiter as an example
|
|
18
|
+
config.logDelimiter = AsciiChars.Carat
|
|
19
|
+
const respawn = new RespawnAcceptor(config)
|
|
20
|
+
return respawn.waitFor()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
protected getInitiator (config: IJsFixConfig): Promise<any> {
|
|
24
|
+
return new RecoveringTcpInitiator(config, c => new SkeletonClient(c)).run()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const l = new AppLauncher()
|
|
29
|
+
l.run().then(() => {
|
|
30
|
+
console.log('finished.')
|
|
31
|
+
}).catch((e: Error) => {
|
|
32
|
+
console.error(e.message)
|
|
33
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IJsFixConfig, IJsFixLogger } from '../../../config'
|
|
2
|
+
import { acceptor } from '../../../transport'
|
|
3
|
+
import { SkeletonServer } from './skeleton-server'
|
|
4
|
+
|
|
5
|
+
export class RespawnAcceptor {
|
|
6
|
+
private readonly logger: IJsFixLogger
|
|
7
|
+
|
|
8
|
+
constructor (public readonly config: IJsFixConfig) {
|
|
9
|
+
this.logger = config.logFactory.logger('RespawnAcceptor')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// if acceptor errors e.g. via a forced connection drop, then respawn
|
|
13
|
+
// a set number of times.
|
|
14
|
+
|
|
15
|
+
public async waitFor (respawns: number = 1): Promise<any> {
|
|
16
|
+
return new Promise<any>(async (resolve, reject) => {
|
|
17
|
+
let respawned = 0
|
|
18
|
+
while (respawned <= respawns) {
|
|
19
|
+
try {
|
|
20
|
+
this.logger.info(`waitFor: waiting for acceptor respawned = ${respawned}`)
|
|
21
|
+
await acceptor(this.config, (c) => {
|
|
22
|
+
const dropConnectionTimeout = respawned === 0 ? 5 : -1
|
|
23
|
+
this.logger.info(`waitFor: create a new acceptor session respawned = ${respawned}, dropConnectionTimeout = ${dropConnectionTimeout}`)
|
|
24
|
+
return new SkeletonServer(c, dropConnectionTimeout)
|
|
25
|
+
})
|
|
26
|
+
break
|
|
27
|
+
} catch (e) {
|
|
28
|
+
this.logger.info(`waitFor: error in acceptor respawned = ${respawned}`)
|
|
29
|
+
}
|
|
30
|
+
++respawned
|
|
31
|
+
}
|
|
32
|
+
if (respawned > 0) {
|
|
33
|
+
this.logger.info(`acceptor respawned reject = ${respawned}`)
|
|
34
|
+
reject(respawned)
|
|
35
|
+
} else {
|
|
36
|
+
this.logger.info(`resolve = ${respawned}`)
|
|
37
|
+
resolve(respawned)
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { MsgView } from '../../../buffer'
|
|
2
|
+
import { AsciiSession } from '../../../transport'
|
|
3
|
+
import { IJsFixLogger, IJsFixConfig } from '../../../config'
|
|
4
|
+
|
|
5
|
+
export class SkeletonClient extends AsciiSession {
|
|
6
|
+
private readonly logger: IJsFixLogger
|
|
7
|
+
private readonly fixLog: IJsFixLogger
|
|
8
|
+
|
|
9
|
+
constructor (public readonly config: IJsFixConfig,
|
|
10
|
+
public readonly logoutSeconds: number = 45) {
|
|
11
|
+
super(config)
|
|
12
|
+
this.logReceivedMsgs = true
|
|
13
|
+
this.fixLog = config.logFactory.plain(`jsfix.${config.description.application.name}.txt`)
|
|
14
|
+
this.logger = config.logFactory.logger(`${this.me}`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected onApplicationMsg (msgType: string, view: MsgView): void {
|
|
18
|
+
// dispatch messages
|
|
19
|
+
switch (msgType) {
|
|
20
|
+
default: {
|
|
21
|
+
this.logger.info(`received message type ${msgType}`)
|
|
22
|
+
break
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// use msgType for example to persist only trade capture messages to database
|
|
28
|
+
protected onDecoded (msgType: string, txt: string): void {
|
|
29
|
+
this.fixLog.info(txt)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// delimiter substitution now done in encoding
|
|
33
|
+
protected onEncoded (msgType: string, txt: string): void {
|
|
34
|
+
this.fixLog.info(txt)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
38
|
+
this.logger.info(`peer logs in user ${user}`)
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
protected onReady (view: MsgView): void {
|
|
43
|
+
this.logger.info('onReady')
|
|
44
|
+
const logoutSeconds = this.logoutSeconds
|
|
45
|
+
this.logger.info(`will logout after ${logoutSeconds}`)
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
this.done()
|
|
48
|
+
}, logoutSeconds * 1000)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
protected onStopped (): void {
|
|
52
|
+
this.logger.info('stopped')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MsgView } from '../../../buffer'
|
|
2
|
+
import { AsciiSession } from '../../../transport'
|
|
3
|
+
import { IJsFixLogger, IJsFixConfig } from '../../../config'
|
|
4
|
+
|
|
5
|
+
export class SkeletonServer extends AsciiSession {
|
|
6
|
+
private readonly logger: IJsFixLogger
|
|
7
|
+
private readonly fixLog: IJsFixLogger
|
|
8
|
+
|
|
9
|
+
constructor (public readonly config: IJsFixConfig,
|
|
10
|
+
public readonly dropConnectionTimeout: number) {
|
|
11
|
+
super(config)
|
|
12
|
+
this.logReceivedMsgs = true
|
|
13
|
+
this.fixLog = config.logFactory.plain(`jsfix.${config.description.application.name}.txt`)
|
|
14
|
+
this.logger = config.logFactory.logger(`${this.me}`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected onApplicationMsg (msgType: string, view: MsgView): void {
|
|
18
|
+
// dispatch messages
|
|
19
|
+
switch (msgType) {
|
|
20
|
+
default: {
|
|
21
|
+
this.logger.info(`received message type ${msgType}`)
|
|
22
|
+
break
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// use msgType for example to persist only trade capture messages to database
|
|
28
|
+
protected onDecoded (msgType: string, txt: string): void {
|
|
29
|
+
this.fixLog.info(txt)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// delimiter substitution now done in encoding
|
|
33
|
+
protected onEncoded (msgType: string, txt: string): void {
|
|
34
|
+
this.fixLog.info(txt)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
38
|
+
this.logger.info(`peer logs in user ${user}`)
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
protected onReady (view: MsgView): void {
|
|
43
|
+
this.logger.info('onReady')
|
|
44
|
+
if (this.dropConnectionTimeout > 0) {
|
|
45
|
+
this.logger.info(`acceptor is ready for requests - drop connection in ${this.dropConnectionTimeout}`)
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
setImmediate(() => {
|
|
48
|
+
this.logger.info(`kill transport`)
|
|
49
|
+
this.stop(new Error(`loss of tcp. ${this.me}`))
|
|
50
|
+
})
|
|
51
|
+
}, this.dropConnectionTimeout * 1000)
|
|
52
|
+
} else {
|
|
53
|
+
this.logger.info(`acceptor is ready for requests`)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
protected onStopped (): void {
|
|
58
|
+
this.logger.info('stopped')
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { MsgView } from '../../../buffer'
|
|
2
2
|
import { AsciiSession } from '../../../transport'
|
|
3
3
|
import { IJsFixLogger, IJsFixConfig } from '../../../config'
|
|
4
|
+
import { ILooseObject } from '../../../collections/collection'
|
|
4
5
|
|
|
5
6
|
export class SkeletonSession extends AsciiSession {
|
|
6
7
|
private readonly logger: IJsFixLogger
|
|
7
8
|
private readonly fixLog: IJsFixLogger
|
|
9
|
+
|
|
8
10
|
constructor (public readonly config: IJsFixConfig,
|
|
9
|
-
public readonly logoutSeconds: number = 45
|
|
11
|
+
public readonly logoutSeconds: number = 45,
|
|
12
|
+
public useInMemoryStore: boolean = false) {
|
|
10
13
|
super(config)
|
|
11
14
|
this.logReceivedMsgs = true
|
|
12
15
|
this.fixLog = config.logFactory.plain(`jsfix.${config.description.application.name}.txt`)
|
|
@@ -15,22 +18,41 @@ export class SkeletonSession extends AsciiSession {
|
|
|
15
18
|
|
|
16
19
|
protected onApplicationMsg (msgType: string, view: MsgView): void {
|
|
17
20
|
// dispatch messages
|
|
21
|
+
if (this.useInMemoryStore) {
|
|
22
|
+
const rec = view.toMsgStoreRecord()
|
|
23
|
+
this.store.put(rec).then(r => {
|
|
24
|
+
this.logger.info(`store state ${JSON.stringify(r, null, 4)}`)
|
|
25
|
+
this.dispatch(msgType, view)
|
|
26
|
+
}).catch(e => {
|
|
27
|
+
this.logger.error(e)
|
|
28
|
+
})
|
|
29
|
+
} else {
|
|
30
|
+
this.dispatch(msgType, view)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private dispatch (msgType: string, view: MsgView) {
|
|
35
|
+
const o = view.toObject()
|
|
18
36
|
switch (msgType) {
|
|
19
37
|
default: {
|
|
20
|
-
this.logger.info(`received message type ${msgType}`)
|
|
38
|
+
this.logger.info(`received message type ${msgType} ${JSON.stringify(o, null, 4)}`)
|
|
21
39
|
break
|
|
22
40
|
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
43
|
|
|
44
|
+
public sendMessage (msgType: string, obj: ILooseObject): void {
|
|
45
|
+
this.send(msgType, obj)
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
// use msgType for example to persist only trade capture messages to database
|
|
27
49
|
protected onDecoded (msgType: string, txt: string): void {
|
|
28
50
|
this.fixLog.info(txt)
|
|
29
51
|
}
|
|
30
52
|
|
|
31
|
-
//
|
|
53
|
+
// delimiter substitution now done in encoding
|
|
32
54
|
protected onEncoded (msgType: string, txt: string): void {
|
|
33
|
-
this.fixLog.info(
|
|
55
|
+
this.fixLog.info(txt)
|
|
34
56
|
}
|
|
35
57
|
|
|
36
58
|
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TradeCaptureClient, TradeCaptureServer } from '../
|
|
1
|
+
import { TradeCaptureClient, TradeCaptureServer } from '../trade-capture'
|
|
2
2
|
import { IJsFixConfig } from '../../../config'
|
|
3
3
|
import { Launcher } from '../../launcher'
|
|
4
4
|
import { initiator, acceptor } from '../../../transport'
|
|
File without changes
|
|
File without changes
|
|
@@ -47,9 +47,15 @@ export class TradeCaptureClient extends AsciiSession {
|
|
|
47
47
|
this.fixLog.info(txt)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//
|
|
50
|
+
// delimiter substitution now done in encoding
|
|
51
51
|
protected onEncoded (msgType: string, txt: string): void {
|
|
52
|
-
this.fixLog.info(
|
|
52
|
+
this.fixLog.info(txt)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private logoutTimer (logoutSeconds: number = 32) {
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
this.done()
|
|
58
|
+
}, logoutSeconds * 1000)
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
protected onReady (view: MsgView): void {
|
|
@@ -59,12 +65,11 @@ export class TradeCaptureClient extends AsciiSession {
|
|
|
59
65
|
this.send(MsgType.TradeCaptureReportRequest, tcr)
|
|
60
66
|
const logoutSeconds = 32
|
|
61
67
|
this.logger.info(`will logout after ${logoutSeconds}`)
|
|
62
|
-
|
|
63
|
-
this.done()
|
|
64
|
-
}, logoutSeconds * 1000)
|
|
68
|
+
this.logoutTimer()
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
protected onLogon (view: MsgView, user: string, password: string): boolean {
|
|
72
|
+
this.logger.info(`onLogon user ${user}`)
|
|
68
73
|
return true
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -56,9 +56,9 @@ export class TradeCaptureServer extends AsciiSession {
|
|
|
56
56
|
this.fixLog.info(txt)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
//
|
|
59
|
+
// delimiter substitution now done in encoding
|
|
60
60
|
protected onEncoded (msgType: string, txt: string): void {
|
|
61
|
-
this.fixLog.info(
|
|
61
|
+
this.fixLog.info(txt)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
private tradeCaptureReportRequest (tcr: ITradeCaptureReportRequest): void {
|
|
File without changes
|