Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8850635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:56:55+00:00 2026-06-14T12:56:55+00:00

I am using the python code examples from http://www.quickfixengine.org and have a question. I

  • 0

I am using the python code examples from “http://www.quickfixengine.org” and have a question. I create my application using the code segment shown below

import quickfix

if len(sys.argv) < 2: return
fileName = sys.argv[1]

try:
    settings = quickfix.SessionSettings(fileName)
    application = quickfix.MyApplication()
    storeFactory = quickfix.FileStoreFactory(settings)
    logFactory = quickfix.FileLogFactory(settings)
    initiator = quickfix.SocketInitiator(application, storeFactory, settings, logFactory)
    initiator.start()
    # while condition == true: do something
    initiator.stop()
except quickfix.ConfigError, e:
    print e

The connection is made and I get logged in, and now I want to send a message (an order, for example). The provided code segment for that is:

def sendOrderCancelRequest:
    message = quickfix.Message();
    header = message.getHeader();

    header.setField(...)
    *<...build the header and body...>*
    message.setField(...)

    Session.sendToTarget(message)

My question is about that Session object. Where/How is that created? Does it get created with something like Session = quickfix.Session(), or something else that they are not showing? I’ve tried a few things, but with the dearth of documentation its just trial and error…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:56:56+00:00Added an answer on June 14, 2026 at 12:56 pm

    Session is not an object, it’s a class. In this case, sendToTarget() is static method.

    Session, maintains a class-static list of sessions. sendToTarget()‘s uses the header fields in your message (or those you explicitly supply) to determine which session to send on.


    EDIT: I misread your question. Here’s an answer to what you asked.

    The session is created in the bowels of the QF engine. It’s created by a SessionFactory, which is itself created in the initialize() function of Initiator and Acceptor. This is stuff you only need to get into if you feel like hacking on the engine source.

    As an app developer, you really don’t need a handle to the session. If you think you do, then I’m guessing you’re probably planning to do something that is not recommended (such as wanting to programmatically reset seq#s, which is a common newbie Bad Idea on the QF lists).

    If you really want a handle to it, you can use Session.lookupSession() or one of the getSession() functions of Initiator or Acceptor. But again, I don’t see any reason to bother. I’m a seasoned QF user, and I had to go look this up, because it’s something I never ever do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using code from this site: http://www.saltycrane.com/blog/2008/09/simplistic-python-thread-example/ The code is import time from threading import
I'm using exactly the code in the examples from here: http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html#Auth Still no dice.
I am using python to code. I have been trying to webscrape the names,
I have some python code using shutil.copyfile: import os import shutil src='C:\Documents and Settings\user\Desktop\FilesPy'
Overnight hack, trying to create an environment where GAE code (using Python libs/packages) could
I have a Python script adapted from Downloading MMS emails sent to Gmail using
I am using python's very high level layer to embed some python code to
Here is the my python code using BeautifulSoup. The main issue is with the
I am writing Python code in Visual Studio 2010 using the excellent Python Tools
I am trying to count characters in comments included in C code using Python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.