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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElasticBuffer, MsgView, SegmentType } from '../buffer'
|
|
2
2
|
import { IJsFixConfig, IJsFixLogger } from '../config'
|
|
3
3
|
import { FixSessionState, SessionState } from './fix-session-state'
|
|
4
4
|
import { MsgTransport } from './msg-transport'
|
|
@@ -7,7 +7,7 @@ import { ILooseObject } from '../collections/collection'
|
|
|
7
7
|
|
|
8
8
|
import * as events from 'events'
|
|
9
9
|
|
|
10
|
-
export abstract class FixSession {
|
|
10
|
+
export abstract class FixSession extends events.EventEmitter {
|
|
11
11
|
public logReceivedMsgs: boolean = false
|
|
12
12
|
protected timer: NodeJS.Timer = null
|
|
13
13
|
protected transport: MsgTransport = null
|
|
@@ -17,17 +17,18 @@ export abstract class FixSession {
|
|
|
17
17
|
protected readonly initiator: boolean
|
|
18
18
|
protected readonly acceptor: boolean
|
|
19
19
|
protected readonly sessionState: FixSessionState
|
|
20
|
-
protected readonly emitter: events.EventEmitter
|
|
21
20
|
protected readonly sessionLogger: IJsFixLogger
|
|
22
21
|
protected requestLogoutType: string
|
|
23
22
|
protected respondLogoutType: string
|
|
24
23
|
protected requestLogonType: string
|
|
25
24
|
|
|
26
25
|
protected constructor (public readonly config: IJsFixConfig) {
|
|
26
|
+
super()
|
|
27
27
|
const description = config.description
|
|
28
|
-
this.emitter = new events.EventEmitter()
|
|
29
28
|
this.me = description.application.name
|
|
30
|
-
this.sessionState = new FixSessionState(
|
|
29
|
+
this.sessionState = new FixSessionState(
|
|
30
|
+
{ heartBeat: config.description.HeartBtInt,
|
|
31
|
+
lastPeerMsgSeqNum: config.description.LastReceivedSeqNum})
|
|
31
32
|
this.sessionLogger = config.logFactory.logger(`${this.me}:FixSession`)
|
|
32
33
|
this.initiator = description.application.type === 'initiator'
|
|
33
34
|
this.acceptor = !this.initiator
|
|
@@ -35,29 +36,73 @@ export abstract class FixSession {
|
|
|
35
36
|
this.sessionState.compId = description.SenderCompId
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
public
|
|
39
|
+
public setState (state: SessionState) {
|
|
40
|
+
if (state === this.sessionState.state) return
|
|
41
|
+
const logger = this.sessionLogger
|
|
42
|
+
const prevState = this.sessionState.state
|
|
43
|
+
const msg = `current state ${SessionState[prevState]} (${prevState}) moves to ${SessionState[state]} (${state})`
|
|
44
|
+
logger.info(msg)
|
|
45
|
+
this.sessionState.state = state
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public getState (): SessionState {
|
|
49
|
+
return this.sessionState.state
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public sendLogon () {
|
|
53
|
+
this.send(this.requestLogonType, this.config.factory.logon())
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private waitPromise (): Promise<any> {
|
|
39
57
|
const logger = this.sessionLogger
|
|
40
|
-
if (this.transport) {
|
|
41
|
-
logger.info('reset from previous transport.')
|
|
42
|
-
this.reset()
|
|
43
|
-
}
|
|
44
|
-
this.transport = transport
|
|
45
|
-
this.subscribe()
|
|
46
58
|
return new Promise<any>((accept, reject) => {
|
|
47
59
|
if (this.initiator) {
|
|
48
|
-
logger.debug(
|
|
49
|
-
this.
|
|
60
|
+
logger.debug(`initiator sending logon state = ${this.stateString()}`)
|
|
61
|
+
this.sendLogon()
|
|
62
|
+
this.setState(SessionState.InitiationLogonSent)
|
|
63
|
+
} else {
|
|
64
|
+
logger.debug(`acceptor waits for logon state = ${this.stateString()}`)
|
|
65
|
+
this.setState(SessionState.WaitingForALogon)
|
|
50
66
|
}
|
|
51
|
-
|
|
67
|
+
|
|
68
|
+
this.on('error', (e: Error) => {
|
|
52
69
|
logger.error(e)
|
|
53
70
|
reject(e)
|
|
54
71
|
})
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
|
|
73
|
+
this.on('done', () => {
|
|
74
|
+
accept(this.transport.id)
|
|
57
75
|
})
|
|
58
76
|
})
|
|
59
77
|
}
|
|
60
78
|
|
|
79
|
+
public run (transport: MsgTransport): Promise<number> {
|
|
80
|
+
const logger = this.sessionLogger
|
|
81
|
+
if (this.transport) {
|
|
82
|
+
logger.info(`reset from previous transport. state ${this.stateString()}`)
|
|
83
|
+
this.reset()
|
|
84
|
+
}
|
|
85
|
+
this.transport = transport
|
|
86
|
+
this.subscribe()
|
|
87
|
+
return this.waitPromise()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected expectedState (): boolean {
|
|
91
|
+
switch (this.sessionState.state) {
|
|
92
|
+
case SessionState.ActiveNormalSession:
|
|
93
|
+
case SessionState.ReceiveLogout:
|
|
94
|
+
case SessionState.Stopped:
|
|
95
|
+
case SessionState.ConfirmingLogout:
|
|
96
|
+
case SessionState.HandleResendRequest:
|
|
97
|
+
case SessionState.AwaitingProcessingResponseToTestRequest:
|
|
98
|
+
case SessionState.AwaitingProcessingResponseToResendRequest:
|
|
99
|
+
return true
|
|
100
|
+
|
|
101
|
+
default:
|
|
102
|
+
return false
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
61
106
|
protected subscribe () {
|
|
62
107
|
|
|
63
108
|
const transport = this.transport
|
|
@@ -85,8 +130,23 @@ export abstract class FixSession {
|
|
|
85
130
|
this.terminate(e)
|
|
86
131
|
})
|
|
87
132
|
|
|
88
|
-
rx.on('done', () =>
|
|
89
|
-
|
|
133
|
+
rx.on('done', () => {
|
|
134
|
+
logger.info('rx done received')
|
|
135
|
+
this.done()
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
rx.on('end', () => {
|
|
139
|
+
logger.info(`rx end received sessionState = [${this.sessionState.toString()}]`)
|
|
140
|
+
const expectedState = this.expectedState()
|
|
141
|
+
if (expectedState) {
|
|
142
|
+
logger.info(`rx graceful end state = ${this.stateString()}`)
|
|
143
|
+
this.done()
|
|
144
|
+
} else {
|
|
145
|
+
const e = new Error(`unexpected state - transport failed? = ${this.stateString()}`)
|
|
146
|
+
logger.info(`rx error ${e.message}`)
|
|
147
|
+
this.terminate(e)
|
|
148
|
+
}
|
|
149
|
+
})
|
|
90
150
|
|
|
91
151
|
rx.on('decoded', (msgType: string, data: ElasticBuffer, ptr: number) => {
|
|
92
152
|
logger.debug(`rx: [${msgType}] ${ptr} bytes`)
|
|
@@ -98,34 +158,65 @@ export abstract class FixSession {
|
|
|
98
158
|
this.terminate(e)
|
|
99
159
|
})
|
|
100
160
|
|
|
101
|
-
tx.on('encoded', (msgType: string, data:
|
|
161
|
+
tx.on('encoded', (msgType: string, data: string) => {
|
|
102
162
|
logger.debug(`tx: [${msgType}] ${data.length} bytes`)
|
|
103
|
-
this.onEncoded(msgType, data
|
|
163
|
+
this.onEncoded(msgType, data)
|
|
104
164
|
})
|
|
105
165
|
}
|
|
106
166
|
|
|
167
|
+
protected validStateApplicationMsg (): boolean {
|
|
168
|
+
switch (this.sessionState.state) {
|
|
169
|
+
case SessionState.Idle:
|
|
170
|
+
case SessionState.InitiateConnection:
|
|
171
|
+
case SessionState.InitiationLogonSent:
|
|
172
|
+
case SessionState.WaitingForALogon:
|
|
173
|
+
case SessionState.HandleResendRequest:
|
|
174
|
+
case SessionState.AwaitingProcessingResponseToTestRequest:
|
|
175
|
+
case SessionState.AwaitingProcessingResponseToResendRequest:
|
|
176
|
+
return false
|
|
177
|
+
default:
|
|
178
|
+
return true
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
protected stateString (): string {
|
|
183
|
+
return SessionState[this.sessionState.state]
|
|
184
|
+
}
|
|
185
|
+
|
|
107
186
|
protected checkForwardMsg (msgType: string, view: MsgView): void {
|
|
108
187
|
this.sessionLogger.info(`forwarding msgType = '${msgType}' to application`)
|
|
188
|
+
this.setState(SessionState.ActiveNormalSession)
|
|
109
189
|
this.onApplicationMsg(msgType, view)
|
|
110
190
|
}
|
|
111
191
|
|
|
112
192
|
protected terminate (error: Error): void {
|
|
193
|
+
if (this.sessionState.state === SessionState.Stopped) return
|
|
113
194
|
this.sessionLogger.error(error)
|
|
114
|
-
|
|
115
|
-
|
|
195
|
+
if (this.timer) {
|
|
196
|
+
clearInterval(this.timer)
|
|
197
|
+
}
|
|
198
|
+
if (this.transport) {
|
|
199
|
+
this.transport.end()
|
|
200
|
+
}
|
|
201
|
+
this.transport = null
|
|
202
|
+
this.setState(SessionState.Stopped)
|
|
203
|
+
this.emit('error', error)
|
|
116
204
|
}
|
|
117
205
|
|
|
118
206
|
protected peerLogout (view: MsgView) {
|
|
119
207
|
const msg = view.getString(MsgTag.Text)
|
|
120
|
-
|
|
208
|
+
const state = this.sessionState.state
|
|
209
|
+
switch (state) {
|
|
121
210
|
case SessionState.WaitingLogoutConfirm: {
|
|
122
211
|
this.sessionLogger.info(`peer confirms logout Text = '${msg}'`)
|
|
123
212
|
this.stop()
|
|
124
213
|
break
|
|
125
214
|
}
|
|
126
215
|
|
|
127
|
-
case SessionState.
|
|
128
|
-
|
|
216
|
+
case SessionState.InitiationLogonResponse:
|
|
217
|
+
case SessionState.ActiveNormalSession:
|
|
218
|
+
case SessionState.InitiationLogonReceived: {
|
|
219
|
+
this.setState(SessionState.ConfirmingLogout)
|
|
129
220
|
this.sessionLogger.info(`peer initiates logout Text = '${msg}'`)
|
|
130
221
|
this.sessionLogout()
|
|
131
222
|
}
|
|
@@ -133,9 +224,10 @@ export abstract class FixSession {
|
|
|
133
224
|
}
|
|
134
225
|
|
|
135
226
|
protected send (msgType: string, obj: ILooseObject) {
|
|
136
|
-
|
|
227
|
+
const state = this.sessionState.state
|
|
228
|
+
switch (state) {
|
|
137
229
|
case SessionState.Stopped: {
|
|
138
|
-
this.sessionLogger.warning(`can't send in
|
|
230
|
+
this.sessionLogger.warning(`can't send in state ${this.stateString()}`)
|
|
139
231
|
break
|
|
140
232
|
}
|
|
141
233
|
|
|
@@ -147,20 +239,28 @@ export abstract class FixSession {
|
|
|
147
239
|
}
|
|
148
240
|
}
|
|
149
241
|
|
|
242
|
+
protected sendLogout (msg: string) {
|
|
243
|
+
const factory = this.config.factory
|
|
244
|
+
this.sessionLogger.info(`sending logout with ${msg}`)
|
|
245
|
+
this.send(this.requestLogoutType, factory.logout(this.requestLogoutType, msg))
|
|
246
|
+
}
|
|
247
|
+
|
|
150
248
|
protected sessionLogout (): void {
|
|
151
249
|
const sessionState = this.sessionState
|
|
152
250
|
if (sessionState.logoutSentAt) {
|
|
153
251
|
return
|
|
154
252
|
}
|
|
155
|
-
|
|
253
|
+
|
|
156
254
|
switch (sessionState.state) {
|
|
157
|
-
case SessionState.
|
|
255
|
+
case SessionState.ActiveNormalSession:
|
|
256
|
+
case SessionState.InitiationLogonResponse:
|
|
257
|
+
case SessionState.InitiationLogonReceived: {
|
|
158
258
|
// this instance initiates logout
|
|
159
|
-
|
|
259
|
+
this.setState(SessionState.WaitingLogoutConfirm)
|
|
160
260
|
sessionState.logoutSentAt = new Date()
|
|
161
261
|
const msg = `${this.me} initiate logout`
|
|
162
262
|
this.sessionLogger.info(msg)
|
|
163
|
-
this.
|
|
263
|
+
this.sendLogout(msg)
|
|
164
264
|
break
|
|
165
265
|
}
|
|
166
266
|
|
|
@@ -169,7 +269,7 @@ export abstract class FixSession {
|
|
|
169
269
|
sessionState.logoutSentAt = new Date()
|
|
170
270
|
const msg = `${this.me} confirming logout`
|
|
171
271
|
this.sessionLogger.info(msg)
|
|
172
|
-
this.
|
|
272
|
+
this.sendLogout(msg)
|
|
173
273
|
break
|
|
174
274
|
}
|
|
175
275
|
|
|
@@ -181,7 +281,9 @@ export abstract class FixSession {
|
|
|
181
281
|
|
|
182
282
|
public done (): void {
|
|
183
283
|
switch (this.sessionState.state) {
|
|
184
|
-
case SessionState.
|
|
284
|
+
case SessionState.InitiationLogonResponse:
|
|
285
|
+
case SessionState.ActiveNormalSession:
|
|
286
|
+
case SessionState.InitiationLogonReceived: {
|
|
185
287
|
this.sessionLogout()
|
|
186
288
|
break
|
|
187
289
|
}
|
|
@@ -195,25 +297,36 @@ export abstract class FixSession {
|
|
|
195
297
|
break
|
|
196
298
|
}
|
|
197
299
|
}
|
|
198
|
-
this.sessionLogger.info(`done. check logout sequence`)
|
|
300
|
+
this.sessionLogger.info(`done. check logout sequence state ${this.stateString()}`)
|
|
199
301
|
}
|
|
200
302
|
|
|
201
303
|
public reset (): void {
|
|
304
|
+
if (this.timer) {
|
|
305
|
+
clearInterval(this.timer)
|
|
306
|
+
}
|
|
202
307
|
this.transport = null
|
|
203
|
-
this.sessionState.
|
|
204
|
-
this.
|
|
308
|
+
this.sessionState.reset(true) // from header def ... eventually
|
|
309
|
+
this.setState(SessionState.NetworkConnectionEstablished)
|
|
205
310
|
}
|
|
206
311
|
|
|
207
|
-
protected stop (): void {
|
|
312
|
+
protected stop (error: Error = null): void {
|
|
208
313
|
if (this.sessionState.state === SessionState.Stopped) {
|
|
209
314
|
return
|
|
210
315
|
}
|
|
211
|
-
|
|
316
|
+
if (this.timer) {
|
|
317
|
+
clearInterval(this.timer)
|
|
318
|
+
}
|
|
212
319
|
this.sessionLogger.info(`stop: kill transport`)
|
|
213
320
|
this.transport.end()
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
321
|
+
if (error) {
|
|
322
|
+
this.sessionLogger.info(`stop: emit error ${error.message}`)
|
|
323
|
+
this.emit('error', error)
|
|
324
|
+
} else {
|
|
325
|
+
this.emit('done')
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
this.setState(SessionState.Stopped)
|
|
329
|
+
this.onStopped(error)
|
|
217
330
|
this.transport = null
|
|
218
331
|
}
|
|
219
332
|
|
|
@@ -227,7 +340,7 @@ export abstract class FixSession {
|
|
|
227
340
|
// inform application peer has logged in - provide login message
|
|
228
341
|
protected abstract onReady (view: MsgView): void
|
|
229
342
|
// inform application this session has now ended - either from logout or connection dropped
|
|
230
|
-
protected abstract onStopped (): void
|
|
343
|
+
protected abstract onStopped (error?: Error): void
|
|
231
344
|
// does the application accept the inbound logon request
|
|
232
345
|
protected abstract onLogon (view: MsgView, user: string, password: string): boolean
|
|
233
346
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ISessionDescription } from './../session-description'
|
|
2
|
+
import { ILooseObject } from '../../collections/collection'
|
|
3
|
+
import { MsgType } from '../../types'
|
|
4
|
+
import { ASessionMsgFactory, ObjectMutator } from '../a-session-msg-factory'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
IStandardHeader,
|
|
8
|
+
IUserRequest,
|
|
9
|
+
IUserResponse,
|
|
10
|
+
UserRequestType,
|
|
11
|
+
UserStatus
|
|
12
|
+
} from '../../types/FIXML50SP2'
|
|
13
|
+
|
|
14
|
+
export class FixmlSessionMsgFactory extends ASessionMsgFactory {
|
|
15
|
+
|
|
16
|
+
constructor (readonly description: ISessionDescription, mutator: ObjectMutator = null) {
|
|
17
|
+
super(description, mutator)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public logon (userRequestId: string = '', isResponse: boolean = false): ILooseObject {
|
|
21
|
+
return this.fixmlLogon(userRequestId, isResponse)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public logout (msgType: string, text: string): ILooseObject {
|
|
25
|
+
return this.fixmlLogout(msgType, msgType !== 'UserReq')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public header (msgType: string, seqNum: number = 0, time: Date = new Date(), overrideData?: Partial<IStandardHeader>): ILooseObject {
|
|
29
|
+
const description = this.description
|
|
30
|
+
const o: IStandardHeader = {
|
|
31
|
+
SenderCompID: description.SenderCompId,
|
|
32
|
+
TargetCompID: description.TargetCompID,
|
|
33
|
+
SenderSubID: description.SenderSubID,
|
|
34
|
+
TargetSubID: description.TargetSubID
|
|
35
|
+
} as IStandardHeader
|
|
36
|
+
return this.mutate(o, 'StandardHeader')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private fixmlLogon (userRequestId: string, isResponse: boolean): ILooseObject {
|
|
40
|
+
const description = this.description
|
|
41
|
+
if (!isResponse) {
|
|
42
|
+
const o: IUserRequest = {
|
|
43
|
+
Username: description.Username,
|
|
44
|
+
Password: description.Password,
|
|
45
|
+
UserRequestID: userRequestId,
|
|
46
|
+
UserRequestType: UserRequestType.LogOnUser
|
|
47
|
+
} as IUserRequest
|
|
48
|
+
return this.mutate(o, MsgType.Logon)
|
|
49
|
+
} else {
|
|
50
|
+
const o: IUserResponse = {
|
|
51
|
+
Username: description.Username,
|
|
52
|
+
UserRequestID: userRequestId,
|
|
53
|
+
UserStatus: UserStatus.LoggedIn
|
|
54
|
+
} as IUserResponse
|
|
55
|
+
return this.mutate(o, MsgType.Logon)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private fixmlLogout (userRequestId: string, isResponse: boolean): ILooseObject {
|
|
60
|
+
if (!isResponse) {
|
|
61
|
+
const o: IUserRequest = {
|
|
62
|
+
Username: this.description.Username,
|
|
63
|
+
UserRequestID: userRequestId,
|
|
64
|
+
UserRequestType: UserRequestType.LogOffUser
|
|
65
|
+
} as IUserRequest
|
|
66
|
+
return this.mutate(o, MsgType.Logout)
|
|
67
|
+
} else {
|
|
68
|
+
const o: IUserResponse = {
|
|
69
|
+
Username: this.description.Username,
|
|
70
|
+
UserRequestID: userRequestId,
|
|
71
|
+
UserStatus: UserStatus.NotLoggedIn
|
|
72
|
+
} as IUserResponse
|
|
73
|
+
return this.mutate(o, MsgType.Logout)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -69,7 +69,7 @@ export abstract class FixmlSession extends FixSession {
|
|
|
69
69
|
private peerLogon (view: MsgView) {
|
|
70
70
|
const logger = this.sessionLogger
|
|
71
71
|
const state = this.sessionState
|
|
72
|
-
state.state = SessionState.
|
|
72
|
+
state.state = SessionState.InitiationLogonReceived
|
|
73
73
|
state.peerCompId = view.getTyped(MsgTag.SenderCompID)
|
|
74
74
|
if (this.acceptor) {
|
|
75
75
|
const reqId: string = view.getString('UserReqID')
|
|
@@ -8,6 +8,7 @@ import { Dictionary } from '../../collections'
|
|
|
8
8
|
import * as express from 'express'
|
|
9
9
|
import * as bodyParser from 'body-parser'
|
|
10
10
|
import * as http from 'http'
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid'
|
|
11
12
|
|
|
12
13
|
export class HttpAcceptor extends FixAcceptor {
|
|
13
14
|
private app: express.Express = express()
|
|
@@ -49,11 +50,9 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
private saveTransport (tid: number, transport: MsgTransport): string {
|
|
52
|
-
const uuidv3 = require('uuid/v3')
|
|
53
53
|
this.transports[tid] = transport
|
|
54
|
-
const app = this.config.description.application
|
|
55
54
|
const keys: string[] = Object.keys(this.transports)
|
|
56
|
-
const a =
|
|
55
|
+
const a = uuidv4()
|
|
57
56
|
this.keys.addUpdate(a, transport)
|
|
58
57
|
this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`)
|
|
59
58
|
this.emit('transport', transport)
|
|
@@ -134,13 +133,13 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
134
133
|
const authorise = `${root}authorise`
|
|
135
134
|
const query = `${root}query`
|
|
136
135
|
this.logger.info(`uri: authorise ${authorise}, query ${query}`)
|
|
137
|
-
router.post(authorise, (req: express.Request, res: express.Response) => {
|
|
136
|
+
router.post(authorise, async (req: express.Request, res: express.Response) => {
|
|
138
137
|
if (!req.headers.authorization) {
|
|
139
138
|
this.logger.info('logon')
|
|
140
|
-
this.logon(req, res)
|
|
139
|
+
await this.logon(req, res)
|
|
141
140
|
} else {
|
|
142
141
|
this.logger.info('logout')
|
|
143
|
-
this.logout(req, res)
|
|
142
|
+
await this.logout(req, res)
|
|
144
143
|
}
|
|
145
144
|
})
|
|
146
145
|
|
|
@@ -157,6 +156,8 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
157
156
|
const d = t.duplex
|
|
158
157
|
this.respond(d, res).then(() => {
|
|
159
158
|
this.logger.info(`responded to ${req.url}`)
|
|
159
|
+
}).catch(e => {
|
|
160
|
+
res.send(e)
|
|
160
161
|
})
|
|
161
162
|
d.readable.push(body.fixml)
|
|
162
163
|
}
|
package/src/transport/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './tcp'
|
|
|
2
2
|
export * from './http'
|
|
3
3
|
export * from './ascii'
|
|
4
4
|
export * from './duplex'
|
|
5
|
-
export * from './session-msg-factory'
|
|
5
|
+
export * from './a-session-msg-factory'
|
|
6
6
|
export * from './make-config'
|
|
7
7
|
export * from './fix-acceptor'
|
|
8
8
|
export * from './fix-initiator'
|
|
@@ -40,11 +40,12 @@ export abstract class MsgTransmitter extends events.EventEmitter {
|
|
|
40
40
|
transform (payload: MsgPayload, encoding, done: Function) {
|
|
41
41
|
try {
|
|
42
42
|
const msgType = payload.msgType
|
|
43
|
-
transmitter.
|
|
43
|
+
transmitter.encoder.reset()
|
|
44
44
|
transmitter.encodeMessage(msgType, payload.obj)
|
|
45
|
-
payload.encoded = transmitter.
|
|
45
|
+
payload.encoded = transmitter.encoder.trim()
|
|
46
46
|
this.push(payload.encoded)
|
|
47
|
-
transmitter.
|
|
47
|
+
const encodedTxt = transmitter.buffer.toString()
|
|
48
|
+
transmitter.emit('encoded', msgType, encodedTxt)
|
|
48
49
|
done()
|
|
49
50
|
} catch (e) {
|
|
50
51
|
done(e)
|
|
@@ -17,6 +17,7 @@ export class MsgTransport {
|
|
|
17
17
|
if (!delimiter) {
|
|
18
18
|
throw new Error(`no delimiter char given.`)
|
|
19
19
|
}
|
|
20
|
+
const logDelimiter = config.logDelimiter || AsciiChars.Pipe
|
|
20
21
|
const description = config.description
|
|
21
22
|
const definitions = config.definitions
|
|
22
23
|
const protocol = description.application.protocol
|
|
@@ -25,7 +26,7 @@ export class MsgTransport {
|
|
|
25
26
|
// let parser replace delimiter with Pipe so fix log does not require
|
|
26
27
|
// expensive replace
|
|
27
28
|
this.transmitter = new AsciiMsgTransmitter(config)
|
|
28
|
-
this.receiver = new AsciiParser(definitions, duplex.readable, delimiter,
|
|
29
|
+
this.receiver = new AsciiParser(definitions, duplex.readable, delimiter, logDelimiter)
|
|
29
30
|
break
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -53,7 +54,7 @@ export class MsgTransport {
|
|
|
53
54
|
public wait (): Promise<any> {
|
|
54
55
|
return new Promise<any>((resolve, reject) => {
|
|
55
56
|
this.receiver.on('end', () => {
|
|
56
|
-
resolve(
|
|
57
|
+
resolve(this.id)
|
|
57
58
|
})
|
|
58
59
|
this.receiver.on('error', (e) => {
|
|
59
60
|
reject(e)
|
|
@@ -19,9 +19,11 @@ export function acceptor (config: IJsFixConfig, sessionFactory: MakeFixSession):
|
|
|
19
19
|
accept(true)
|
|
20
20
|
})
|
|
21
21
|
}).catch((e: Error) => {
|
|
22
|
-
logger.error
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
logger.info(`error in session - close listener ${e.message}`)
|
|
23
|
+
acceptor.close(() => {
|
|
24
|
+
logger.info('acceptor closed.')
|
|
25
|
+
reject(e)
|
|
26
|
+
})
|
|
25
27
|
})
|
|
26
28
|
})
|
|
27
29
|
acceptor.listen()
|
|
@@ -19,6 +19,7 @@ export function initiator (config: IJsFixConfig, sessionFactory: MakeFixSession,
|
|
|
19
19
|
accept(true)
|
|
20
20
|
} catch (e) {
|
|
21
21
|
if (!reconnectTimeout) {
|
|
22
|
+
connecting = false
|
|
22
23
|
reject(e)
|
|
23
24
|
} else {
|
|
24
25
|
logger.info(`waiting ${reconnectTimeout} to reconnect following error`)
|