├── .gitignore
├── Client
├── .gitignore
├── App.config
├── App.xaml
├── App.xaml.cs
├── Client.csproj
├── Comms
│ ├── HeartBeatClient.cs
│ ├── IHeartBeatClient.cs
│ ├── ITickerClient.cs
│ ├── NetMQHeartBeatClient.cs
│ ├── NetMQTickerClient.cs
│ ├── ServiceClientBase.cs
│ ├── TickerClient.cs
│ └── Transport
│ │ ├── Connection.cs
│ │ ├── ConnectionInfo.cs
│ │ ├── ConnectionProvider.cs
│ │ ├── ConnectionStatus.cs
│ │ ├── IConnection.cs
│ │ ├── IConnectionProvider - Copy.cs
│ │ └── IConnectionProvider.cs
├── Factory
│ ├── ITickerFactory.cs
│ ├── Ticker.cs
│ └── TickerFactory.cs
├── IOC
│ └── Bootstrapper.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ └── AssemblyInfo.cs
├── Repositories
│ ├── ITickerRepository.cs
│ └── TickerRepository.cs
├── Services
│ ├── ConcurrencyService.cs
│ ├── IConcurrencyService.cs
│ ├── IReactiveTrader.cs
│ ├── IUserProvider.cs
│ ├── ReactiveTrader.cs
│ └── UserProvider.cs
├── ValueConverters
│ └── DecimalPlaceFormatter.cs
├── ViewModels
│ ├── ConnectivityStatusViewModel.cs
│ ├── INPCBase.cs
│ ├── MainWindowViewModel.cs
│ ├── TickerViewModel.cs
│ ├── TickerViewModelFactory.cs
│ └── TickersViewModel.cs
└── packages.config
├── Common
├── .gitignore
├── Common.csproj
├── Extensions
│ └── ObservableExtensions.cs
├── Properties
│ └── AssemblyInfo.cs
├── SnapshotProtocol.cs
├── StreamingProtocol.cs
├── TickerDto.cs
├── ViewModels
│ └── DelegateCommand.cs
└── packages.config
├── NetMQDemo.sln
├── NetMQServer
├── .gitignore
├── App.config
├── App.xaml
├── App.xaml.cs
├── IOC
│ └── Bootstrapper.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MainWindowViewModel.cs
├── NetMQServer.csproj
├── Properties
│ └── AssemblyInfo.cs
├── Ticker
│ ├── ITickerPublisher.cs
│ ├── ITickerRepository.cs
│ ├── NetMQPublisher.cs
│ └── TickerRepository.cs
├── log4net.xml
└── packages.config
└── Video
├── NetMQRx.camproj
└── capture-2.trec
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Dd]ebugPublic/
12 | [Rr]elease/
13 | [Rr]eleases/
14 | x64/
15 | x86/
16 | build/
17 | bld/
18 | [Bb]in/
19 | [Oo]bj/
20 |
21 | # Roslyn cache directories
22 | *.ide/
23 |
24 | # MSTest test Results
25 | [Tt]est[Rr]esult*/
26 | [Bb]uild[Ll]og.*
27 |
28 | #NUNIT
29 | *.VisualState.xml
30 | TestResult.xml
31 |
32 | # Build Results of an ATL Project
33 | [Dd]ebugPS/
34 | [Rr]eleasePS/
35 | dlldata.c
36 |
37 | *_i.c
38 | *_p.c
39 | *_i.h
40 | *.ilk
41 | *.meta
42 | *.obj
43 | *.pch
44 | *.pdb
45 | *.pgc
46 | *.pgd
47 | *.rsp
48 | *.sbr
49 | *.tlb
50 | *.tli
51 | *.tlh
52 | *.tmp
53 | *.tmp_proj
54 | *.log
55 | *.vspscc
56 | *.vssscc
57 | .builds
58 | *.pidb
59 | *.svclog
60 | *.scc
61 |
62 | # Chutzpah Test files
63 | _Chutzpah*
64 |
65 | # Visual C++ cache files
66 | ipch/
67 | *.aps
68 | *.ncb
69 | *.opensdf
70 | *.sdf
71 | *.cachefile
72 |
73 | # Visual Studio profiler
74 | *.psess
75 | *.vsp
76 | *.vspx
77 |
78 | # TFS 2012 Local Workspace
79 | $tf/
80 |
81 | # Guidance Automation Toolkit
82 | *.gpState
83 |
84 | # ReSharper is a .NET coding add-in
85 | _ReSharper*/
86 | *.[Rr]e[Ss]harper
87 | *.DotSettings.user
88 |
89 | # JustCode is a .NET coding addin-in
90 | .JustCode
91 |
92 | # TeamCity is a build add-in
93 | _TeamCity*
94 |
95 | # DotCover is a Code Coverage Tool
96 | *.dotCover
97 |
98 | # NCrunch
99 | _NCrunch_*
100 | .*crunch*.local.xml
101 |
102 | # MightyMoose
103 | *.mm.*
104 | AutoTest.Net/
105 |
106 | # Web workbench (sass)
107 | .sass-cache/
108 |
109 | # Installshield output folder
110 | [Ee]xpress/
111 |
112 | # DocProject is a documentation generator add-in
113 | DocProject/buildhelp/
114 | DocProject/Help/*.HxT
115 | DocProject/Help/*.HxC
116 | DocProject/Help/*.hhc
117 | DocProject/Help/*.hhk
118 | DocProject/Help/*.hhp
119 | DocProject/Help/Html2
120 | DocProject/Help/html
121 |
122 | # Click-Once directory
123 | publish/
124 |
125 | # Publish Web Output
126 | *.[Pp]ublish.xml
127 | *.azurePubxml
128 | # TODO: Comment the next line if you want to checkin your web deploy settings
129 | # but database connection strings (with potential passwords) will be unencrypted
130 | *.pubxml
131 | *.publishproj
132 |
133 | # NuGet Packages
134 | *.nupkg
135 | # The packages folder can be ignored because of Package Restore
136 | **/packages/*
137 | # except build/, which is used as an MSBuild target.
138 | !**/packages/build/
139 | # If using the old MSBuild-Integrated Package Restore, uncomment this:
140 | #!**/packages/repositories.config
141 |
142 | # Windows Azure Build Output
143 | csx/
144 | *.build.csdef
145 |
146 | # Windows Store app package directory
147 | AppPackages/
148 |
149 | # Others
150 | sql/
151 | *.Cache
152 | ClientBin/
153 | [Ss]tyle[Cc]op.*
154 | ~$*
155 | *~
156 | *.dbmdl
157 | *.dbproj.schemaview
158 | *.pfx
159 | *.publishsettings
160 | node_modules/
161 |
162 | # RIA/Silverlight projects
163 | Generated_Code/
164 |
165 | # Backup & report files from converting an old project file
166 | # to a newer Visual Studio version. Backup files are not needed,
167 | # because we have git ;-)
168 | _UpgradeReport_Files/
169 | Backup*/
170 | UpgradeLog*.XML
171 | UpgradeLog*.htm
172 |
173 | # SQL Server files
174 | *.mdf
175 | *.ldf
176 |
177 | # Business Intelligence projects
178 | *.rdl.data
179 | *.bim.layout
180 | *.bim_*.settings
181 |
182 | # Microsoft Fakes
183 | FakesAssemblies/
184 |
--------------------------------------------------------------------------------
/Client/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Others
89 | [Bb]in
90 | [Oo]bj
91 | sql
92 | TestResults
93 | [Tt]est[Rr]esult*
94 | *.Cache
95 | ClientBin
96 | [Ss]tyle[Cc]op.*
97 | ~$*
98 | *.dbmdl
99 | Generated_Code #added for RIA/Silverlight projects
100 |
101 | # Backup & report files from converting an old project file to a newer
102 | # Visual Studio version. Backup files are not needed, because we have git ;-)
103 | _UpgradeReport_Files/
104 | Backup*/
105 | UpgradeLog*.XML
--------------------------------------------------------------------------------
/Client/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Client/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Client/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Windows;
3 | using Autofac;
4 | using Client.Comms;
5 | using Client.IOC;
6 | using Client.Services;
7 | using log4net;
8 |
9 |
10 | namespace Client
11 | {
12 |
13 | public partial class App : Application
14 | {
15 | private static readonly ILog Log = LogManager.GetLogger(typeof(App));
16 |
17 | protected override void OnStartup(StartupEventArgs e)
18 | {
19 | base.OnStartup(e);
20 | InitializeLogging();
21 | Start();
22 | }
23 |
24 | private void Start()
25 | {
26 | var bootstrapper = new Bootstrapper();
27 | var container = bootstrapper.Build();
28 |
29 | Log.Info("Initializing reactive trader API...");
30 | var reactiveTraderApi = container.Resolve();
31 |
32 | var username = container.Resolve().Username;
33 | reactiveTraderApi.Initialize(username, "localhost");
34 |
35 | var mainWindow = container.Resolve();
36 | //var vm = container.Resolve();
37 | //mainWindow.DataContext = vm;
38 | mainWindow.Show();
39 |
40 |
41 |
42 |
43 | var netMQHeartClient = NetMQHeartBeatClient.CreateInstance(null, "ghhasa");
44 |
45 |
46 | }
47 |
48 | private void InitializeLogging()
49 | {
50 | Thread.CurrentThread.Name = "UI";
51 | log4net.Config.XmlConfigurator.Configure();
52 | Log.Info(@"SignalRSelfHost started");
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Client/Client.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {B43264BB-E309-4168-8770-EC0127C63912}
8 | Exe
9 | Properties
10 | Client
11 | Client
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 | Client.App
36 |
37 |
38 |
39 | ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll
40 |
41 |
42 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
43 |
44 |
45 | False
46 | ..\packages\Blend.Interactivity.Wpf.1.0.1340.0\lib\net\Microsoft.Expression.Interactions.dll
47 |
48 |
49 | ..\packages\NetMQ.3.3.0.11\lib\net40\NetMQ.dll
50 |
51 |
52 | False
53 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll
54 |
55 |
56 |
57 |
58 |
59 |
60 | ..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll
61 |
62 |
63 | ..\packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll
64 |
65 |
66 | ..\packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll
67 |
68 |
69 | ..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll
70 |
71 |
72 | ..\packages\Rx-XAML.2.2.5\lib\net45\System.Reactive.Windows.Threading.dll
73 |
74 |
75 | False
76 | ..\packages\Blend.Interactivity.Wpf.1.0.1340.0\lib\net\System.Windows.Interactivity.dll
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | App.xaml
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Code
97 |
98 |
99 | Code
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | MainWindow.xaml
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 | Designer
130 |
131 |
132 |
133 |
134 | {09ecea5a-a3cd-4f9a-92dc-7d282be5bc0e}
135 | Common
136 |
137 |
138 |
139 |
140 | MSBuild:Compile
141 | Designer
142 |
143 |
144 |
145 |
146 | MSBuild:Compile
147 | Designer
148 |
149 |
150 |
151 |
152 |
159 |
--------------------------------------------------------------------------------
/Client/Comms/HeartBeatClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reactive.Disposables;
5 | using System.Reactive.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using Client.Comms;
9 | using Client.Comms.Transport;
10 | using NetMQ;
11 |
12 | namespace Client.Hub
13 | {
14 | public class HeartBeatClient : IHeartBeatClient
15 | {
16 | public IObservable ConnectionStatusStream()
17 | {
18 | return Observable.Create(observer =>
19 | {
20 | NetMQHeartBeatClient.Instance.InitialiseComms();
21 |
22 | var disposable = NetMQHeartBeatClient.Instance.GetConnectionStatusStream().Subscribe(observer);
23 | return new CompositeDisposable { disposable };
24 | })
25 | .Publish()
26 | .RefCount();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Client/Comms/IHeartBeatClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Client.Comms.Transport;
7 | using Common;
8 |
9 | namespace Client.Hub
10 | {
11 | public interface IHeartBeatClient
12 | {
13 | IObservable ConnectionStatusStream();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Client/Comms/ITickerClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Common;
7 |
8 | namespace Client.Comms
9 | {
10 | internal interface ITickerClient
11 | {
12 | IObservable GetTickerStream();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Client/Comms/NetMQHeartBeatClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reactive.Linq;
5 | using System.Reactive.Subjects;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using Client.Factory;
10 | using Client.Comms.Transport;
11 | using Common;
12 | using NetMQ;
13 | using NetMQ.Actors;
14 | using NetMQ.InProcActors;
15 | using NetMQ.Sockets;
16 | using NetMQ.zmq;
17 | using Newtonsoft.Json;
18 | using Poller = NetMQ.Poller;
19 |
20 | namespace Client.Comms
21 | {
22 | public class NetMQHeartBeatClient
23 | {
24 | private readonly NetMQContext context;
25 | private readonly string address;
26 | private Actor