任何建议如何修复错误消息库 [英] Any suggestions how do I fix error messagestore

查看:85
本文介绍了任何建议如何修复错误消息库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MessageStore'是'FIX.MessageStore'和'QuickFix.MessageStore'之间的模糊参考



使用系统;

使用系统.Collections.Generic;

使用System.Linq;

使用System.Text;

使用System.Threading.Tasks;

使用System.Xml.Linq;

使用System.Windows;

使用System.Windows.Input;

使用System。 Text.RegularExpressions;

使用System.Windows.Forms;

使用System.IO;

使用QuickFix;

使用SystemDataType = System.ComponentModel.DataAnnotations.DataType;



命名空间FIX

{

内部类连接:ConnectionBase< messagestore>

{

private SslTunnel _sslTunnel;

public Session Session {get;私人集; }



public void Create(int senderSeqNum,int targetSeqNum)

{

Create();



Session = Session.lookupSession(SessionID);

Session.setNextSenderMsgSeqNum(senderSeqNum);

Session.setNextTargetMsgSeqNum( targetSeqNum);



var ssl =(bool)Program.Props [Prop.SSL] .Value;

_sslTunnel = ssl? new SslTunnel(Program.Props [Prop.Host] .Value.ToString(),(int)Program.Props [Prop.Port] .Value):null;

}



public override void打开(字符串用户名,字符串密码)

{

if(_sslTunnel!= null)

_sslTunnel.Open();

base.Open(用户名,密码);

}



protected override SessionSettings GetSessionSettings()

{

var stream = new MemoryStream(1024);

var writer = new StreamWriter(stream);



var ssl =(bool)Program.Props [Prop.SSL] .Value;



writer .WriteLine([DEFAULT]);

writer.WriteLine(ConnectionType = {0},initiator);

writer.WriteLine(HeartBtInt = {0},Program.Props [Prop.Heartb eatInterval] .Value);

if(ssl)

{

writer.WriteLine(SocketConnectHost = localhost);

writer.WriteLine(SocketConnectPort = {0},SslTunnel.LocalPort);

}

其他

{

writer.WriteLine(SocketConnectHost = {0},Program.Props [Prop.Host] .Value);

writer.WriteLine(SocketConnectPort = {0}, Program.Props [Prop.Port] .Value);

}

writer.WriteLine(ReconnectInterval = {0},Program.Props [Prop.ReconnectInterval]。值);

writer.WriteLine(UseDataDictionary = {0},'N');

writer.WriteLine(MillisecondsInTimestamp = {0},(bool )Program.Props [Prop.MillisecondsInTimestamp] .Value? 'Y':'N');



writer.WriteLine([SESSION]);

writer.WriteLine(BeginString = {0},Program.Props [Prop.BeginString] .Value);

writer.WriteLine(SenderCompID = {0},Program.Props [Prop.SenderCompID] .Value);

writer.WriteLine(TargetCompID = {0},Program.Props [Prop.TargetCompID] .Value);



writer。 WriteLine(StartTime = {0},Tools.LocalToUtc((TimeSpan)Program.Props [Prop.SessionStart] .Value));

writer.WriteLine(EndTime = {0}, Tools.LocalToUtc((TimeSpan)Program.Props [Prop.SessionEnd] .Value));



writer.Flush();

stream.Seek(0,SeekOrigin.Begin);

返回新的SessionSettings(流);

}

}

}



我尝试了什么:



我尝试rebuil d在较低的帧4.5,3.5不起作用



David

MessageStore' is an ambiguous reference between 'FIX.MessageStore' and 'QuickFix.MessageStore'

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Windows;
using System.Windows.Input;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;
using QuickFix;
using SystemDataType = System.ComponentModel.DataAnnotations.DataType;

namespace FIX
{
internal class Connection : ConnectionBase<messagestore>
{
private SslTunnel _sslTunnel;
public Session Session { get; private set; }

public void Create(int senderSeqNum, int targetSeqNum)
{
Create();

Session = Session.lookupSession(SessionID);
Session.setNextSenderMsgSeqNum(senderSeqNum);
Session.setNextTargetMsgSeqNum(targetSeqNum);

var ssl = (bool)Program.Props[Prop.SSL].Value;
_sslTunnel = ssl ? new SslTunnel(Program.Props[Prop.Host].Value.ToString(), (int)Program.Props[Prop.Port].Value) : null;
}

public override void Open(string username, string password)
{
if (_sslTunnel != null)
_sslTunnel.Open();
base.Open(username, password);
}

protected override SessionSettings GetSessionSettings()
{
var stream = new MemoryStream(1024);
var writer = new StreamWriter(stream);

var ssl = (bool)Program.Props[Prop.SSL].Value;

writer.WriteLine("[DEFAULT]");
writer.WriteLine("ConnectionType={0}", "initiator");
writer.WriteLine("HeartBtInt={0}", Program.Props[Prop.HeartbeatInterval].Value);
if (ssl)
{
writer.WriteLine("SocketConnectHost=localhost");
writer.WriteLine("SocketConnectPort={0}", SslTunnel.LocalPort);
}
else
{
writer.WriteLine("SocketConnectHost={0}", Program.Props[Prop.Host].Value);
writer.WriteLine("SocketConnectPort={0}", Program.Props[Prop.Port].Value);
}
writer.WriteLine("ReconnectInterval={0}", Program.Props[Prop.ReconnectInterval].Value);
writer.WriteLine("UseDataDictionary={0}", 'N');
writer.WriteLine("MillisecondsInTimestamp={0}", (bool)Program.Props[Prop.MillisecondsInTimestamp].Value ? 'Y' : 'N');

writer.WriteLine("[SESSION]");
writer.WriteLine("BeginString={0}", Program.Props[Prop.BeginString].Value);
writer.WriteLine("SenderCompID={0}", Program.Props[Prop.SenderCompID].Value);
writer.WriteLine("TargetCompID={0}", Program.Props[Prop.TargetCompID].Value);

writer.WriteLine("StartTime={0}", Tools.LocalToUtc((TimeSpan)Program.Props[Prop.SessionStart].Value));
writer.WriteLine("EndTime={0}", Tools.LocalToUtc((TimeSpan)Program.Props[Prop.SessionEnd].Value));

writer.Flush();
stream.Seek(0, SeekOrigin.Begin);
return new SessionSettings(stream);
}
}
}

What I have tried:

I try to rebuild in lower Frame 4.5 , 3.5 do not work

David

推荐答案

再次读取错误。它告诉你在命名空间QuickFix中有一些定义为'MessageStore'的东西,你的FIX中有一些名为MessageStore的东西。编译器无法告诉你要使用哪一个,所以你必须通过添加前缀来告诉它'MessageStore'与您想要的名称空间的关系,就像在错误消息中一样。
Read the error again. It's telling you that there is something defined as 'MessageStore' in the namespace QuickFix and you have something in your FIX called "MessageStore'. The compiler can't tell which one you want to use so you have to tell it by prefixing your use of 'MessageStore' with the namespace of the one you want, just like in the error message.


这篇关于任何建议如何修复错误消息库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆