-
Notifications
You must be signed in to change notification settings - Fork 581
Closed
Description
Hi, I looking into this code:
quickfixn/QuickFIXn/Transport/SocketInitiator.cs
Lines 55 to 88 in 06c7aa6
| try | |
| { | |
| t.Connect(); | |
| t.Initiator.SetConnected(t.Session.SessionID); | |
| t.Session.Log.Log(LogLevel.Information, "Connection succeeded"); | |
| t.Session.Next(); | |
| while (t.Read()) { | |
| } | |
| if (t.Initiator.IsStopped) | |
| t.Initiator.RemoveThread(t); | |
| t.Initiator.SetDisconnected(t.Session.SessionID); | |
| } | |
| catch (IOException ex) // Can be exception when connecting, during ssl authentication or when reading | |
| { | |
| LogThreadStartConnectionFailed(t, ex); | |
| } | |
| catch (SocketException ex) | |
| { | |
| LogThreadStartConnectionFailed(t, ex); | |
| } | |
| catch (System.Security.Authentication.AuthenticationException ex) // some certificate problems | |
| { | |
| LogThreadStartConnectionFailed(t, ex); | |
| } | |
| catch (Exception ex) | |
| { | |
| LogThreadStartConnectionFailed(t, ex); | |
| } | |
| finally | |
| { | |
| t.Initiator.RemoveThread(t); | |
| t.Initiator.SetDisconnected(t.Session.SessionID); | |
| } |
On line 64 we see
if (t.Initiator.IsStopped) condition for removal, but on line 86 we will remove it any way. SetDisconnected in normal case is called twice too. Are line 64 - 66 redundant?Metadata
Metadata
Assignees
Labels
No labels