아래 링크에서 무역 클라이언트 응용 프로그램을 사용하여 VPS 서버와 브로커 서버 중 하나를 연결합니다.QuickFIX/n - 초 기자가 로그온 단계에서 반복적으로 오류가 발생합니다.
http://www.quickfixn.org/tutorial/example-applications.
투쟁 1 주일 후, 나는 느슨하게 말하면서 중개인의 서버에 연결할 수있었습니다.
나는 무역 클라이언트 응용 프로그램을 실행할 때, 로그온 단계에서 나는 점점 오전이 오류 :
무역 클라이언트 응용 프로그램 로그온 시도하지만,이 같은 오류 메시지가 표시 계속 반복 유지하고있다Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host
at QuickFix.SocketInitiatorThread.ReadSome(Byte[] buffer, Int32 timeoutMilliseconds)
in ... SoecketInitiatorThread.cs:line 170 ......
at QuickFix.SocketInitiatorThread.Read() in ... SoecketInitiatorThread.cs:line 80
......
만.
물론이 QuickFix/n 엔진에 대한 저와 같은 초보자들과 함께 무엇이 잘못되었는지 알 수 없습니다. 내가 생각할 수있는 한 가지 가능한 조사 영역은 stunnel program (https://www.stunnel.org)에 대한 새로운 내용이기 때문에 나의 stunnel 인증서가 유효하지 않을 수도 있다는 것입니다. 브로커의 IP 주소로 pem 인증서를 구성하기 위해 웹 사이트의 지시를 따랐을 뿐이었지만 그 목적에 대해서는 100 % 확실하지는 않습니다. 나는 "되는 Stunnel 이상 사용하여 인증서를 내장
2014.11.26 17:23:44 LOG5[3348]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2014.11.26 17:23:48 LOG5[760]: Service [FIXORDER] accepted connection from x.xx.xx.xxx:xx
2014.11.26 17:23:48 LOG5[760]: s_connect: connected xxx.x.xx.xxx:xxx
2014.11.26 17:23:48 LOG5[760]: Service [FIXORDER] connected remote server from x.xx.xxx.xxx:xxx
2014.11.26 17:23:48 LOG3[760]: SSL_connect: Peer suddenly disconnected
2014.11.26 17:23:48 LOG5[760]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
: 여기
[FIXORDER]
client = yes
accept = external ip of VPS : port eg.(10.160.103.65:22)
connect = broker ip address :port eg.(102.12.124.9:444)
가되는 Stunnel 프로그램에서 기록 된 메시지의 일부 기록이다 : 여기
내가"stunnel.conf "파일에 넣어 것입니다 .conf "파일에 내장 된 자체 인증서 응용 프로그램을 사용합니다.
알다시피, 나 같은 초보자에게는 다소 복잡합니다.이 문제에 대한 생각이나 조언은 정말 감사 할 것입니다.
미리 감사드립니다.
친절하게 제공합니다.
M
========================================= =========================== 2014 년 7 월 27 일에 업데이트되었습니다.
여기 디버깅 정보를 xapi1492에서 제안한 debug high로 설정하면 Stunnel 로그 파일에서 내 오류 로그가 업데이트됩니다.
2014.11.27 01:10:46 LOG7[944]: Service [FIXORDER] started
2014.11.27 01:10:46 LOG5[944]: Service [FIXORDER] accepted connection from x.xxx.xxx.xxx:3667
2014.11.27 01:10:46 LOG6[944]: s_connect: connecting xx.x.xx.xx:9002
2014.11.27 01:10:46 LOG7[944]: s_connect: s_poll_wait xx.x.xx.102:9002: waiting 10 seconds
2014.11.27 01:10:46 LOG5[944]: s_connect: connected xx.x.xx.xx:9002
2014.11.27 01:10:46 LOG5[944]: Service [FIXORDER] connected remote server from x.xxx.xxx.xxx:3668
2014.11.27 01:10:46 LOG7[944]: Remote socket (FD=392) initialized
2014.11.27 01:10:46 LOG6[944]: SNI: sending servername: xxx.x.xx.xx
2014.11.27 01:10:46 LOG7[944]: SSL state (connect): before/connect initialization
2014.11.27 01:10:46 LOG7[944]: SSL state (connect): SSLv2/v3 write client hello A
2014.11.27 01:10:46 LOG3[944]: SSL_connect: Peer suddenly disconnected
2014.11.27 01:10:46 LOG5[944]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2014.11.27 01:10:46 LOG7[944]: Remote socket (FD=392) closed
2014.11.27 01:10:46 LOG7[944]: Local socket (FD=380) closed
2014.11.27 01:10:46 LOG7[944]: Service [FIXORDER] finished (0 left)
=========================================== ======================= 2014 년 8 월 11 일에 업데이트되었습니다.
여전히 답을 찾기가 어려워서 QuickFix 클라이언트 응용 프로그램에 대한 설정 파일을 제공하기로 결정했습니다.
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=2
FileStorePath=store
FileLogPath=fixlog
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=FIX44.xml
SocketConnectHost= xxx //my vps ip address
SocketConnectPort= xxx //my vps port //specified on stunnel
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y
CheckLatency=N
LogonTimeout=10
# standard config elements
[SESSION]
BeginString=FIX.4.4
SenderCompID= xxx //my ID
Username= xxx //my username
Password= xxx //my password
TargetCompID=FIXORDER
HeartBtInt=30
SocketConnectHost= xxx //my vps ip address
SocketConnectPort= xxx //my vps port //specified on stunnel
DataDictionary=FIX44.xml
=========================================== ======================= 2014 년 8 월 11 일에 업데이트되었습니다.
xpa1492에서 제안을 받으면 Borker의 IP 주소와 포트 번호를 SocketConnectHost 과 SocketConnectPort에 넣습니다. QuickFix 클라이언트 응용 프로그램에서 얻는 로그 메시지는 다음과 같습니다. 초기 연결이 이루어졌지만 로그온 요청이 어떻게 든 유효하지 않은 것으로 보입니다.
<event> connecting to xxx (ip address of broker);
<event> connection succeeded;
<event> session reset: ResetOnLogon;
<event> session reset ResetSetNumFlag;
<outgoing> 8=Fix4.4 ...... ;
<event> initiated logon request;
<incoming> 8=FIX4.4 .....;
<event> received logout request;
<outgoing> 8=FIX4.4 .....;
<event> sending logout response;
로그 아웃 요청을 보낼 때 브로커로부터 들어오는 메시지의 세부 사항.
<incoming> 8=FIX4.4 9=63 35=5 34=1 49=FIXORDER 52=20141128-02:09:00.495 56=TargetCompID(from acceptor standing point of view=SenderID for me) 10=171
stunnel 프로그램의 로그 파일에 녹음 된 메시지를 추가하여 질문을 편집했습니다. 다행히도 이제 스스로 문제가 더 명확 해지기를 바랍니다. – auto9817
업데이트 좋은 답변 주셔서 정말로 감사드립니다. 이 [클라이언트가 연결하는 포트 번호]를 임의로 할당 할 수 있는지 궁금하십니까? 먼저 무료 포트를 찾기 위해 스캐너를 사용해야합니까? 또한 xxx_cert.pem 및 xxx_key.pem은 어디서 구할 수 있습니까? stunnel 폴더를 검색했지만 FEMORDER에 대한 파일이 아닌 다른 3 개의 PEM 파일이 있습니다. – auto9817
서버가 SSL을 요구하면 올바른 키와 인증서를 사용해야합니다. 그들이 없으면 (보통 QA/UAT 환경의 경우입니다), 아마도 SSL을 필요로하지 않을 것입니다. 원하는 포트를 사용할 수 있습니다 (다른 응용 프로그램에서 사용하지 않는 한). 일반적으로 최대 1024 개의 포트가 예약되어 있으므로 1024보다 큰 값을 사용해야합니다 (충돌이 매우 드문 경우). – xpa1492