Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quickfix Socket Error: Connection reset by peer c++

I'm getting a "Socket Error: Connection reset by peer" message using the tradeclient c++ demo code from the quickfix download.

another user commented that it was related to network issues. if anyone has the solution it would be appreciated.

QuickFix C++ Socket Error Connection Reset By Peer?

<20141221-17:32:11.049, FIX.4.4:myusername->hostusername, event>
      (Created session)
    <20141221-17:32:11.056, FIX.4.4:myusername-> hostusername, event>
      (Connecting to fix.hostusername.com on port 5001)
    <20141221-17:32:11.221, FIX.4.4:myusername-> hostusername, outgoing>
      (8=FIX.4.49=10735=A34=149=myusername =20141221-17:32:11.21856= hostusername    98=0108=30141=Y10=000)
    <20141221-17:32:11.221, FIX.4.4:myusername-> hostusername, event>
      (Initiated logon request)
    <20141221-17:32:11.253, FIX.4.4:myusername-> hostusername, event>
      (Socket Error: Connection reset by peer.)
    <20141221-17:32:11.253, FIX.4.4:myusername-> hostusername, event>
      (Disconnecting)

think i found the reason. the host I'm trying to connect with is using quickfix java which supports SSL. the quickfix c++ client doesn't seem to support the SSL enable tag in the session settings. finally had to resort to wireshark to determine this. i searched all over the web and many people were reporting this similar error. i hope this post saves them any anyone in the future from debugging endlessly to solve this "Socket Error: Connection reset by peer" error.

like image 948
geiger zaehler Avatar asked May 20 '26 18:05

geiger zaehler


1 Answers

Two reasons I am aware of for "Socket Error: Connection reset by peer" are:-

1) Your SenderCompId/TargetCompId does not match with that of other side. In that case just make sure you are using correct one.

2) Other one is that sequence number expected by server is something different what you are sending. In that case just try with ResetOnLogon field ( in your registry file )to No and check if that resolves the issue.

There can be many reasons for this error. However, I doubt it that network is responsible for this error as connection request has been sent to server properly. You could search through the internet for wider range of answers.

like image 142
ravi Avatar answered May 22 '26 08:05

ravi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!