Re: [Quickfix-users] Problem logging in - Socket Error: Connection reset by peer
Brought to you by:
orenmnero
|
From: Joerg T. <Joe...@ma...> - 2005-08-04 08:53:27
|
Hi Chris,
> I am trying to write a simple FIX proxy type process - so that I can
> simulate a busy response.
Just curious: What do you mean by busy response?
>
> The attached code uses quickfix to either accept or initiate connections
> - the aim being to do both at once so that it proxy requests, but at
> the moment, I am having problems getting the acceptor to accept logon
> requests. It starts a connection, but fails to logon. Both processes
> are running on the same machine, but I have turned CheckLatency off,
> just in case.
>
> This is probably a very basic error - but I just can't see it...
>
>
> All I see in the acceptor log is:
> [...]
> <20050804-07:03:16, FIX.4.2:RabobankTest->FixGateway, event>
> [...]
> In the initiator log, I see this:
>
> <20050804-08:03:46, FIX.4.2:RabobankTest->FixGateway, event>
Both sides connect as RabobankTest to FixGateway. This does not match. It should look like
Acceptor: <20050804-07:03:16, FIX.4.2:RabobankTest->FixGateway, event>
Initiator: <20050804-08:03:46, FIX.4.2:FixGateway->RabobankTest, event>
If you look at the fix-in.cfg and fix-out.cfg, both contain
SenderCompID=RabobankTest
TargetCompID=FixGateway
In one of the both configs, this should be
SenderCompID=FixGateway
TargetCompID=RabobankTest
Some other remarks:
Why do you use:
ResetOnDisconnect=Y
ResetOnLogout=Y
And you could use the isLoggedOn() method of the session instead of using a _loggedOn
variable. This variable is not thread-safe, ie the JVM spec does not guarantee that
another thread sees the actual value of _loggedOn. Please use
private synchronized boolean getLoggedOn() { return this._loggedOn; }
private synchronized setLoggedOn( final boolean loggedOn } { this._loggedOn = loggedOn; }
Do you know that you can send message to a FIX session even if it is not logged on? I.e.
this check is not necessary, except you explitely want that behaviour.
Cheers, Jörg
--
Joerg Thoennes
http://macd.com
Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH
Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen
|