22 #ifndef STREAMCONNECTION_H_
23 #define STREAMCONNECTION_H_
231 virtual ~StreamBuffer();
238 const StreamContactHeader
handshake(
const StreamContactHeader &header);
282 virtual std::char_traits<char>::int_type overflow(std::char_traits<char>::int_type = std::char_traits<char>::eof());
283 virtual std::char_traits<char>::int_type underflow();
294 void __error()
const;
304 STREAM_FAILED = 1 << 0,
307 STREAM_HANDSHAKE = 1 << 3,
308 STREAM_SHUTDOWN = 1 << 4,
309 STREAM_CLOSED = 1 << 5,
310 STREAM_REJECT = 1 << 6,
311 STREAM_SKIP = 1 << 7,
312 STREAM_ACK_SUPPORT = 1 << 8,
313 STREAM_NACK_SUPPORT = 1 << 9,
314 STREAM_SOB = 1 << 10,
315 STREAM_TIMER_SUPPORT = 1 << 11
320 bool get(
const StateBits bit)
const;
321 void set(
const StateBits bit);
322 void unset(
const StateBits bit);
332 std::vector<char> in_buf_;
335 std::vector<char> out_buf_;
339 std::iostream &_stream;
346 std::queue<StreamDataSegment> _rejected_segments;
348 Length _underflow_data_remain;
349 State _underflow_state;
354 void connectionTimeout();
359 void eventBundleRefused();
360 void eventBundleForwarded();
362 StreamConnection::Callback &_callback;
366 StreamConnection::StreamBuffer _buf;