You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FIX客户端登录时连接被重置的问题排查咨询

FIX客户端与服务器连接重置问题排查求助

测试FIX客户端与服务器交互时遇到连接重置问题,客户端日志显示连接被对方重置,请求协助排查原因,相关信息如下:

FIX客户端日志

<event> 创建会话
<event> 连接到127.0.0.1的5001端口
2023年2月1日 下午2:50:32 inf: [FixClient] ToAdmin: FIX.4.4:CLIENT->SERVER [98, 2], [108, 30]
<event> 连接成功
<event> 会话重置: ResetOnLogon
2023年2月1日 下午2:50:32 inf: [FixClient] ToAdmin: FIX.4.4:CLIENT->SERVER [98, 0], [108, 30], [141, Y]
<event> 会话重置: ResetSeqNumFlag
<outgoing> 8=FIX.4.49=7335=A34=149=CLIENT52=20230201-14:50:32.20356=SERVER98=0108=30141=Y10=177
<event> 发起登录请求
<event> 会话 FIX.4.4:CLIENT->SERVER 断开连接: System.Net.Sockets.SocketException (54): 连接被对方重置
   在 QuickFix.SocketInitiatorThread.ReadSome(Byte[] buffer, Int32 timeoutMilliseconds)
   在 QuickFix.SocketInitiatorThread.Read()
2023年2月1日 下午2:50:32 inf: [FixClient] OnLogout: FIX.4.4:CLIENT->SERVER
<event> 会话重置: ResetOnDisconnect

客户端代码(C#)

SessionID sessionId = new SessionID("FIX.4.4", "CLIENT", "SERVER");

var logon = new QuickFix.FIX44.Logon {
    EncryptMethod = new EncryptMethod(EncryptMethod.None),
    HeartBtInt = new HeartBtInt(30)
};

Session.SendToTarget(logon, sessionId);

client.cfg配置

[DEFAULT]
ConnectionType=initiator
ReconnectInterval=30
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=./FIX/spec/FIX44.xml
SocketConnectHost=127.0.0.1
SocketConnectPort=5001
LogoutTimeout=5
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y

[SESSION]
# 从DEFAULT继承ConnectionType、ReconnectInterval和SenderCompID
BeginString=FIX.4.4
SenderCompID=CLIENT
TargetCompID=SERVER
HeartBtInt=30

server.cfg配置

[DEFAULT]
ConnectionType=acceptor
SocketAcceptPort=5001
StartTime=00:00:00
EndTime=00:00:00
FileLogPath=log
UseDataDictionary=Y
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y

[SESSION]
BeginString=FIX.4.4
SenderCompID=CLIENT
TargetCompID=SERVER
FileStorePath=store
DataDictionary=./FIX/spec/FIX44.xml

内容的提问来源于stack exchange,提问作者Joe Phillips

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 06:20:27