Merge branch 'master' of bitbucket.org:bluetradesys/spark into SPARK-2179-PIQ

This commit is contained in:
Eric Harding committed 2019-04-26 09:38:43 -04:00
commit 38d79eb58b
4 files changed
+43 -24

No files matched your search

+39 -18
View File
@@ -75,6 +75,41 @@ namespace mbts.ui.shell
Environment.Exit(0);
}
void start_stunnel(string path, uint job_error)
{
string config_error;
if (!mbts.config.Configuration.try_initialize(out config_error))
{
_stunnel_process = Process.Start(path + "bin\\stunnel.exe");
if (_stunnel_process != null)
{
for (int i = 0; i < 10; i++)
{
if (mbts.config.Configuration.try_initialize(out config_error))
break;
System.Threading.Thread.Sleep(500);
}
}
else
stunnel_job_error = "Stunnel Job Error code: " + job_error +
" could not start stunnel " + (config_error ?? string.Empty);
}
}
void kill_stunnel()
{
try
{
Process[] ps = Process.GetProcessesByName("stunnel");
ps.ForEach(p =>
{
try { p.Kill(); }
catch {}
});
}
catch { }
}
Process _stunnel_process;
static internal string stunnel_job_error { get; private set;}
void init_stunnel(string[] argv)
@@ -85,24 +120,10 @@ namespace mbts.ui.shell
if (File.Exists(path + "config\\stunnel.conf"))
{
uint job_error = BTSUINativeMethods.setup_process_job_object();
if(job_error == 0)
{
_stunnel_process = Process.Start(path + "bin\\stunnel.exe");
string config_error; bool success = false;
if(_stunnel_process != null)
{
for(int i = 0; i < 10; i++)
{
if(success = mbts.config.Configuration.try_initialize(out config_error))
break;
System.Threading.Thread.Sleep(500);
}
}
else
stunnel_job_error = "Stunnel Job Error code: " + job_error + " could not start stunnel";
}
else
stunnel_job_error = "Stunnel Job Error code: " + job_error;
//if we can't put this process and stunnel into a job, try to stop stunnel then restart
if(job_error != 0)
kill_stunnel();
start_stunnel(path, job_error);
}
}
catch(Exception ex)
+2 -1
View File
@@ -4,7 +4,8 @@
<Authors>Blue Trading Systems</Authors>
<Company>Blue Trading Systems</Company>
<Product>Spark</Product>
<Description>The game has changed. Make your Move.</Description>
<Description>Advanced Derivatives Trading</Description>
<ApplicationManifest>spark.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Configurations>Debug;Release</Configurations>
<Platforms>x64</Platforms>
+1 -1
View File
@@ -9,7 +9,7 @@ using System.Linq;
namespace sparkcmd {
class Program {
static int Main(string[] args) {
mbts.config.Configuration.initialize();
mbts.utils.BTSNativeMethods.provide_command_line(args, args.Length);
var commands = ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program));
return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out);
}
+1 -4
View File
@@ -382,10 +382,7 @@ public:
google::protobuf::MapPair<uint32_t,std::string> v(h.handle.key(), security.ice().security_desc());
x->insert(v);
}
else
{
LOG(md,Error, "Invalid ExchangeData_case {}", security.ExchangeData_case());
}
// There is currently no ExchangeData for synthetics
}
}
}