Merge branch 'master' of bitbucket.org:bluetradesys/spark

This commit is contained in:
Taha Afzal committed 2017-10-23 11:40:34 -04:00
commit 4884981837
12 files changed
+77 -66

No files matched your search

+1 -1
View File
@@ -9,4 +9,4 @@ obj/
msbuild.log
*.orig
vcxproj.user
launchSettings.json
src/client/spark/Properties/launchSettings.json
+21 -3
View File
@@ -1,7 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/gcc_debug/src/server/sparkd/sparkd",
"args": ["run"],
"stopAtEntry": false,
"cwd": "${workspaceRoot}/build/gcc_debug/src/server/sparkd",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Client Launch",
"type": "clr",
@@ -11,8 +29,8 @@
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"externalConsole": true
},
{
},
{
"name": "Client Attach",
"type": "clr",
"request": "attach",
@@ -1,8 +0,0 @@
{
"profiles": {
"Spark": {
"commandName": "Project",
"workingDirectory": "$(OutputPath)"
}
}
}
+1 -1
View File
@@ -34,7 +34,7 @@
<PackageReference Include="IronPython" Version="2.7.7" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit" Version="3.8.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="protobuf-net" Version="2.3.2" />
+41 -40
View File
@@ -1,4 +1,4 @@
using bts.api;
using bts.api;
using bts.api.core;
using bts.api.test;
using NUnit.Framework;
@@ -64,6 +64,7 @@ namespace mbts.api.Test {
[Test]
public void hello_server_test() {
//System.Windows.MessageBox.Show("attach debugger");
_mtest.run_hello_service(null);
_mtest.run_shout_service(null);
@@ -71,48 +72,48 @@ namespace mbts.api.Test {
var h = _context.locate<HelloService>();
TableUpdate<HelloLog, string> last_update = null;
h.subscribe_greetings().table().Subscribe(t => last_update = t);
using (var sub1 = h.subscribe_greetings().table().Subscribe(t => last_update = t)) {
var response = h.say_hello(new HelloRequest() { Name = "UnitTest 1" });
Assert.AreEqual("Hello UnitTest 1", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 0);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "Hello UnitTest 1");
last_update = null;
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 2" });
Assert.AreEqual("HELLO UNITTEST 2", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 2");
last_update = null;
var response = h.say_hello(new HelloRequest() { Name = "UnitTest 1" });
Assert.AreEqual("Hello UnitTest 1", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 0);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "Hello UnitTest 1");
last_update = null;
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 2" });
Assert.AreEqual("HELLO UNITTEST 2", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 2");
last_update = null;
// Managed shout, Native hello
_mtest.stop_hello_service(null);
_ntest.run_hello_service(null);
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 3" });
Assert.AreEqual("HELLO UNITTEST 3", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 3");
last_update = null;
// Native+native
_mtest.stop_shout_service(null);
_ntest.run_shout_service(null);
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 4" });
Assert.AreEqual("HELLO UNITTEST 4", response.Message);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 4");
last_update = null;
// Managed shout, Native hello
_mtest.stop_hello_service(null);
_ntest.run_hello_service(null);
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 3" });
Assert.AreEqual("HELLO UNITTEST 3", response.Message);
Assert.NotNull(last_update);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 3");
last_update = null;
// Native+native
_mtest.stop_shout_service(null);
_ntest.run_shout_service(null);
response = h.yell_hello(new HelloRequest() { Name = "UnitTest 4" });
Assert.AreEqual("HELLO UNITTEST 4", response.Message);
Assert.True(last_update.added.Count == 1);
Assert.True(last_update.removed.Count == 1);
Assert.True(last_update.state.Count == 1);
Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 4");
last_update = null;
}
_ntest.stop_hello_service(null);
_ntest.stop_shout_service(null);
}
@@ -14,7 +14,6 @@ namespace bts.api.core {
internal class QuickbusClientChannel : ClientChannel {
IntPtr _client;
List<IntPtr> _subscriptions = new List<IntPtr>();
public QuickbusClientChannel(ServiceContext context, string type_name, string qualifier) : base(context) {
_client = ApiNativeMethods.api_client_create(context.native_context, type_name, qualifier);
@@ -22,10 +21,6 @@ namespace bts.api.core {
}
public override void Dispose() {
foreach (var sub in _subscriptions) {
ApiNativeMethods.api_client_unsubscribe(_client, sub);
}
_subscriptions.Clear();
ApiNativeMethods.api_client_destroy(_client);
_client = IntPtr.Zero;
}
@@ -84,10 +79,8 @@ namespace bts.api.core {
}
};
var subscription = ApiNativeMethods.api_client_subscribe(_client, method_and_qualifier, cb, IntPtr.Zero);
_subscriptions.Add(subscription);
return FinalizeableAnonymousDisposable.Create((disposing) => {
ApiNativeMethods.api_client_unsubscribe(_client, subscription);
_subscriptions.Remove(subscription);
// keepalive
cb = null;
if (!disposing) {
+1 -1
View File
@@ -20,7 +20,7 @@ ServiceContext::~ServiceContext() {
}
std::unique_ptr<ClientChannel> ServiceContext::create_channel(const char * type_name, const char * service_qualifier) const {
LOG(Api,Info,"Locate Service: {}{}",type_name ,service_qualifier);
LOG(Api,Info,"Locate Service: {}{}",std::string(type_name) ,std::string(service_qualifier));
return std::unique_ptr<ClientChannel>(new QuickbusClientChannel(_qbus, type_name, service_qualifier));
}
+7 -1
View File
@@ -71,7 +71,7 @@ JetFIX {
platform: GLBX
socket_connect_host_ip: "69.50.112.177"
socket_connect_port: 61924
sender_compid: "MC7004N"
sender_compid: "MC8004N"
target_compid: "CME"
target_subid: "64"
start_time: "00:30:00"
@@ -142,5 +142,11 @@ SparkConnection {
rule: "System.host_name=='TAHA-SUPER_spark'"
value {connection_name: "cme_mc1"}
}
# Jake Chapel Hill CME Cert-accessible host
SparkConnection {
rule: "System.host_name=='bts-host15'"
value {connection_name: "cme_mc8"}
}
SparkConnection {value {connection_name: "cme_mbx"}}
+1 -1
View File
@@ -53,7 +53,7 @@ struct CheckPtr<Head,Tail...> : public CheckPtr<Tail...> {
template <size_t SZ, typename... Args>
void pack_msg_args(std::array<uint8_t,SZ> &buffer,Args&&...args) {
using Store = std::tuple<typename std::remove_reference<Args>::type...>;
static_assert(CheckPtr<Args...>::value,"Illegal type logged");
static_assert(CheckPtr<typename std::remove_reference<Args>::type...>::value,"Illegal type logged");
if(sizeof(Store) <= SZ)
new (&buffer[0]) Store(std::forward<Args>(args)...);
else {
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
echo $SCRIPTPATH
$SCRIPTPATH/replicate_to_windows_vm.py && ssh -p 2222 bts@localhost "cd /mnt/c/Users/bts/spark/tools && /mnt/c/Windows/System32/cmd.exe /c clientbuild.cmd"
#$SCRIPTPATH/replicate_to_windows_vm.py && \
ssh -p 2222 bts@localhost "cd /mnt/c/Users/bts/spark/tools && /mnt/c/Windows/System32/cmd.exe /c clientbuild.cmd"
@@ -13,6 +13,7 @@ ignore = Path docker
ignore = Regex .*\.pyc
ignore = Path x64
ignore = Path .vs
repeat = watch
batch = true
'''
+1 -1
View File
@@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
docker run \
--rm \
-i \
--restart=unless-stopped \
-p 8000:8000 \
-p 8001:8001 \
-p 8080:8080 \