Untitled


SUBMITTED BY: Guest

DATE: Aug. 29, 2013, 9:29 p.m.

FORMAT: Text only

SIZE: 3.3 kB

HITS: 10256

  1. Public Class MyQuickFixApp
  2. Inherits MessageCracker : Implements IApplication
  3. Dim _session As Session = Nothing
  4. Public Sub FromAdmin(message As Message, sessionID As SessionID) Implements IApplication.FromAdmin
  5. ClientGUI.RichTextBox1.AppendText("")
  6. ClientGUI.RichTextBox1.AppendText("IN (ADMIN): " + message.ToString())
  7. Try
  8. Crack(message, sessionID)
  9. Catch ex As Exception
  10. ClientGUI.RichTextBox1.AppendText("")
  11. ClientGUI.RichTextBox1.AppendText("==Cracker exception==")
  12. ClientGUI.RichTextBox1.AppendText(ex.ToString())
  13. ClientGUI.RichTextBox1.AppendText(ex.StackTrace)
  14. End Try
  15. End Sub
  16. Public Sub FromApp(message As Message, sessionID As SessionID) Implements IApplication.FromApp
  17. ClientGUI.RichTextBox1.AppendText("")
  18. ClientGUI.RichTextBox1.AppendText("IN (APP): " + message.ToString())
  19. Try
  20. Crack(message, sessionID)
  21. Catch ex As Exception
  22. ClientGUI.RichTextBox1.AppendText("")
  23. ClientGUI.RichTextBox1.AppendText("==Cracker exception==")
  24. ClientGUI.RichTextBox1.AppendText(ex.ToString())
  25. ClientGUI.RichTextBox1.AppendText(ex.StackTrace)
  26. End Try
  27. End Sub
  28. Public Sub ToApp(message As Message, sessionId As SessionID) Implements IApplication.ToApp
  29. Try
  30. Dim possDupFlag As Boolean = False
  31. If (message.Header.IsSetField(Tags.PossDupFlag)) Then
  32. possDupFlag = Converters.BoolConverter.Convert(message.Header.GetField(Tags.PossDupFlag))
  33. End If
  34. If (possDupFlag) Then
  35. Throw New DoNotSend()
  36. End If
  37. Catch ex As FieldNotFoundException
  38. ClientGUI.RichTextBox1.AppendText("OUT (APP): " + message.ToString())
  39. End Try
  40. End Sub
  41. Public Sub OnCreate(sessionID As SessionID) Implements IApplication.OnCreate
  42. '_session = Session.LookupSession(sessionID)
  43. ClientGUI.RichTextBox1.AppendText("Session created - " + sessionID.ToString())
  44. End Sub
  45. Public Sub OnLogon(sessionID As SessionID) Implements IApplication.OnLogon
  46. ClientGUI.RichTextBox1.AppendText("Logon - " + sessionID.ToString())
  47. ClientGUI.ToolStripDropDownButton1.Text = "Connected"
  48. ClientGUI.ToolStripDropDownButton1.Image = My.Resources.Connected
  49. 'MsgBox("onlogon")
  50. End Sub
  51. Public Sub OnLogout(sessionID As SessionID) Implements IApplication.OnLogout
  52. ClientGUI.RichTextBox1.AppendText("Logout - " + sessionID.ToString())
  53. ClientGUI.ToolStripDropDownButton1.Text = "Disconnected"
  54. ClientGUI.ToolStripDropDownButton1.Image = My.Resources.Disconnected
  55. End Sub
  56. Public Sub ToAdmin(message As Message, sessionID As SessionID) Implements IApplication.ToAdmin
  57. ClientGUI.RichTextBox1.AppendText("OUT (ADMIN): " + message.ToString())
  58. End Sub
  59. Public Sub OnMessage(message As FIX42.Heartbeat, sessionID As SessionID)
  60. ClientGUI.RichTextBox1.AppendText("HEARTBEAT")
  61. End Sub
  62. End Class

comments powered by Disqus