fix8
version 1.4.0
Open Source C++ FIX Framework
|
Fix message writer. More...
#include <connection.hpp>
Public Member Functions | |
FIXWriter (Poco::Net::StreamSocket *sock, Session &session, const ProcessModel pmodel=pm_pipeline) | |
virtual | ~FIXWriter () |
Dtor. More... | |
bool | write (Message *from, bool destroy) |
size_t | write_batch (const std::vector< Message * > &msgs, bool destroy) |
int | join () |
bool | write (Message &from) |
bool | poll (const Poco::Timespan &ts=Poco::Timespan()) const |
int | send (const char *data, size_t remaining, bool nb=false) |
virtual void | start () |
Start the processing threads. More... | |
virtual void | stop () |
Send a message to the processing method instructing it to quit. More... | |
virtual F8API int | execute (f8_thread_cancellation_token &cancellation_token) |
virtual void | quit () |
Stop the processing threads and quit. More... | |
Public Member Functions inherited from FIX8::AsyncSocket< Message * > | |
AsyncSocket (Poco::Net::StreamSocket *sock, Session &session, const ProcessModel pmodel=pm_pipeline) | |
virtual | ~AsyncSocket ()=default |
Dtor. More... | |
size_t | queued () const |
bool | started () const |
int | operator() () |
virtual void | request_stop () |
Start the processing thread. More... | |
Poco::Net::StreamSocket * | socket () |
int | join () |
f8_thread_cancellation_token & | cancellation_token () |
Private Attributes | |
f8_spin_lock | _con_spl |
Additional Inherited Members | |
Protected Attributes inherited from FIX8::AsyncSocket< Message * > | |
coroutine | _coro |
Poco::Net::StreamSocket * | _sock |
f8_concurrent_queue< Message * > | _msg_queue |
Session & | _session |
ProcessModel | _pmodel |
f8_thread_cancellation_token | _cancellation_token |
volatile bool | _started |
f8_mutex | _start_mutex |
Fix message writer.
Definition at line 340 of file connection.hpp.
|
inline |
Ctor.
sock | connected socket |
session | session |
pmodel | process model |
Definition at line 349 of file connection.hpp.
|
inlinevirtual |
Dtor.
Definition at line 353 of file connection.hpp.
References quit().
|
virtual |
Writer thread method. Reads messages from the queue and sends them over the socket.
Reimplemented from FIX8::AsyncSocket< Message * >.
Definition at line 269 of file connection.cpp.
References scout_error, scout_info, and FIX8::f8Exception::what().
Referenced by FIX8::Connection::writer_execute().
|
inline |
Wait till writer thead has finished.
Definition at line 412 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_pmodel, FIX8::AsyncSocket< T >::join(), and FIX8::pm_pipeline.
|
inline |
Check to see if a write would block
ts | timeout |
Definition at line 428 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_sock.
Referenced by FIX8::Connection::writer_poll().
|
inlinevirtual |
Stop the processing threads and quit.
Reimplemented from FIX8::AsyncSocket< Message * >.
Definition at line 498 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_pmodel, FIX8::pm_pipeline, and FIX8::AsyncSocket< T >::quit().
Referenced by ~FIXWriter().
|
inline |
Send message over socket.
data | char * buffer to send |
remaining | number of bytes |
nb | - if true, don't block |
Definition at line 438 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_sock.
Referenced by FIX8::Connection::send().
|
inlinevirtual |
Start the processing threads.
Reimplemented from FIX8::AsyncSocket< Message * >.
Definition at line 468 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_pmodel, FIX8::pm_pipeline, and FIX8::AsyncSocket< T >::start().
|
inlinevirtual |
Send a message to the processing method instructing it to quit.
Definition at line 475 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_msg_queue, FIX8::AsyncSocket< Message * >::_pmodel, FIX8::AsyncSocket< Message * >::_start_mutex, FIX8::AsyncSocket< Message * >::_started, glout_warn, FIX8::pm_pipeline, and FIX8::AsyncSocket< T >::request_stop().
|
inline |
Place Fix message on outbound message queue.
from | message to send |
destroy | if true delete after send |
Definition at line 362 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_msg_queue, FIX8::AsyncSocket< Message * >::_pmodel, FIX8::AsyncSocket< Message * >::_session, FIX8::pm_pipeline, and FIX8::Session::send_process().
Referenced by FIX8::Connection::write(), and write_batch().
|
inline |
Send Fix message directly
from | message to send |
Definition at line 417 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_pmodel, FIX8::AsyncSocket< Message * >::_session, FIX8::pm_pipeline, and FIX8::Session::send_process().
|
inline |
Place Fix messages on outbound message queue as a single batch.
msgs | messages to send |
destroy | if true delete after send |
Definition at line 379 of file connection.hpp.
References FIX8::AsyncSocket< Message * >::_msg_queue, FIX8::AsyncSocket< Message * >::_pmodel, FIX8::AsyncSocket< Message * >::_session, FIX8::pm_pipeline, FIX8::Session::send_process(), FIX8::Message::set_end_of_batch(), and write().
Referenced by FIX8::Connection::write_batch().
|
private |
Definition at line 342 of file connection.hpp.