geiger zaehler
geiger zaehler

Reputation: 119

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.

Upvotes: 2

Views: 5448

Answers (4)

Charles Plager
Charles Plager

Reputation: 604

We got this error message when we had not correctly imported the security certificate.

Upvotes: 0

Armali
Armali

Reputation: 19375

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. – geiger zaehler

Upvotes: 0

rupweb
rupweb

Reputation: 3328

Could well be firewall, have you the right IP and port, and permission to get there?

Upvotes: 0

ravi
ravi

Reputation: 10733

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.

Upvotes: 2

Related Questions