[Quickfix-developers] Problem with Session::send (const std::string& string)
Brought to you by:
orenmnero
From: Wjack07 <ck...@gm...> - 2014-07-06 09:30:37
|
Hi: I am trying to trim the latency of sending message by using as less overhead as possible. But I met some weird issue, and have no clue so far. Hope anyone has some idea. Basically, instead of using FIX::Session::sendtotarget ( Message& message) One can use FIX::Session::send ( Message& message)* *But the SessionID needs to be set up first. this can be done separately. But once it is done, we can save this step for every to-be-sent message after (in QuickFIX, it check the sesseionID every time when a message is to be sent, and this slows down a little bit.) Furthermore, one can even use FIX::Session::sendRaw (Message& message)** And this can further save few steps **sendRaw in session.h is in "private" category, so the .h file needs to be modified a bit before using. To push further, I tried FIX::Session::send ( const std::string& string )*** *** again, it is in "private category" so the .h file needs to be modified. Also the string should be well defined before head (for example, from message.ToString). The MegSeqNum issue also needs to be considered. So far so good, and I did successfully send out the message by this way. By using FIX::Session::send ( const std::string& string ), the latency for sending message is significantly reduced. BUT, here is the problem. if I do message.ToString > FIX::Session::send ( const std::string& string ), then the message is sent successfully. if I do message.ToString > modify this string (for example, COrderID from 12345 to 54321)> FIX::Session::send ( const std::string& string ), the message will be written on the log file (or shown on the screen logger) saying it is outgoing, but the server would never respond, which suggesting this message want sent out. What is interesting is, if I do do message.ToString > modify this string (COrderID from 12345 to 54321 by string.erase and then string insert)> modify this string (COrderID from 54321 back to 12345) > FIX::Session::send ( const std::string& string ) then this is successful. This is very weird to me, and it seems the message.ToString automatically set up some flag, and the FIX::Session::send will check that flag (to see if message and message.ToString are matched). I read hose code, but didnt find such a thing. So, my question is, why the modification after message.ToString makes FIX::Session::send ( const std::string& string ) failed? Many thanks Wjack -- View this message in context: http://quickfix.13857.n7.nabble.com/Problem-with-Session-send-const-std-string-string-tp6646.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |