From b5c880e409372bb6bc65c19a188031e7bbc1e7f1 Mon Sep 17 00:00:00 2001 From: Panos Rontogiannis Date: Thu, 21 Jan 2016 11:53:56 +0200 Subject: [PATCH] Added a message type with a VARLEN field to the SOP example. --- examples/EN.csv | 5 +++++ examples/README.md | 3 ++- examples/en.txt | 1 + examples/sop.lua | 7 ++++--- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 examples/EN.csv create mode 100644 examples/en.txt diff --git a/examples/EN.csv b/examples/EN.csv new file mode 100644 index 0000000..8ae768c --- /dev/null +++ b/examples/EN.csv @@ -0,0 +1,5 @@ +Field,Length,Type +msgType,2, +textLen,4, +text,textLen,VARLEN +source,16, diff --git a/examples/README.md b/examples/README.md index e2965b2..cdb6c90 100644 --- a/examples/README.md +++ b/examples/README.md @@ -25,7 +25,8 @@ Type | Description | Spec NO | New Order | NO.csv OC | Order Confirmation | OC.csv TR | Trade | TR.csv -RJ | Rejection | RJ.csv +RJ | Rejection | RJ.csv +EN | Exchange News | EN.csv The specs of the payload of each message can be found at the relevant CSV file. diff --git a/examples/en.txt b/examples/en.txt new file mode 100644 index 0000000..cfe677d --- /dev/null +++ b/examples/en.txt @@ -0,0 +1 @@ +095EN0073This is some news from IMEX, the Imaginary Exchange. How do you find SOP?IMEX  \ No newline at end of file diff --git a/examples/sop.lua b/examples/sop.lua index 96e84d0..c799d20 100644 --- a/examples/sop.lua +++ b/examples/sop.lua @@ -13,9 +13,9 @@ sop = Proto('SOP', 'Simple Order Protocol') -- a table of our default settings - these can be changed by changing -- the preferences through the GUI or command-line. local defaultSettings = { - enable = false, + enable = true, ports = '9001-9010', - trace = false + trace = true } local protoHelper = wsdh.createProtoHelper(sop) protoHelper:setDefaultPreference(defaultSettings) @@ -23,7 +23,8 @@ protoHelper:setDefaultPreference(defaultSettings) local msg_types = { { name = 'NO', file = 'NO.csv' }, { name = 'OC', file = 'OC.csv' }, { name = 'TR', file = 'TR.csv' }, - { name = 'RJ', file = 'RJ.csv' } } + { name = 'RJ', file = 'RJ.csv' }, + { name = 'EN', file = 'EN.csv' } } -- Define fields local SopFields = {