31 #ifndef LIBS_ACN_TCPTRANSPORT_H_ 32 #define LIBS_ACN_TCPTRANSPORT_H_ 35 #include "ola/io/OutputBuffer.h" 36 #include "ola/io/OutputStream.h" 38 #include "ola/network/TCPSocket.h" 39 #include "libs/acn/PDU.h" 40 #include "libs/acn/Transport.h" 41 #include "libs/acn/TransportHeader.h" 64 WAITING_FOR_PDU_FLAGS,
65 WAITING_FOR_PDU_LENGTH,
79 uint8_t *m_buffer_start, *m_buffer_end, *m_data_end;
81 unsigned int m_outstanding_data;
84 unsigned int m_block_size;
85 unsigned int m_consumed_block_size;
87 PDULengthSize m_pdu_length_size;
88 unsigned int m_pdu_size;
90 void HandlePreamble();
91 void HandlePDUFlags();
92 void HandlePDULength();
95 void IncreaseBufferSize(
unsigned int new_size);
96 void ReadRequiredData();
97 void EnterWaitingForPreamble();
98 void EnterWaitingForPDU();
103 inline unsigned int FreeSpace()
const {
104 return m_buffer_start ?
105 static_cast<unsigned int>(m_buffer_end - m_data_end) : 0u;
111 inline unsigned int DataLength()
const {
112 return m_buffer_start ?
113 static_cast<unsigned int>(m_data_end - m_buffer_start) : 0u;
119 inline unsigned int BufferSize()
const {
120 return static_cast<unsigned int>(m_buffer_end - m_buffer_start);
123 static const unsigned int INITIAL_SIZE;
124 static const unsigned int PDU_BLOCK_SIZE = 4;
137 bool Receive() {
return m_transport->Receive(); }
140 std::auto_ptr<IncomingStreamTransport> m_transport;
144 #endif // LIBS_ACN_TCPTRANSPORT_H_
An abstract PDU inflator.
Definition: BaseInflator.h:64
Definition: TCPTransport.h:51
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
IncomingStreamTransport(class BaseInflator *inflator, ola::io::ConnectedDescriptor *descriptor, const ola::network::IPV4SocketAddress &source)
Definition: TCPTransport.cpp:54
Definition: TCPSocket.h:43
~IncomingStreamTransport()
Definition: TCPTransport.cpp:76
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: TCPTransport.h:131
An IPv4 SocketAddress.
Definition: SocketAddress.h:78
bool Receive()
Definition: TCPTransport.cpp:87