Overview
Features
Download
Documentation
Community
Add-Ons & Services

Plumbing StreamSockets to std::streambuf

Discussion of ideas for features and new projects based on POCO.

Plumbing StreamSockets to std::streambuf

Postby philipp » 11 Apr 2012, 00:56

I have an app (much like an ALG, or application-level gateway) that reads data from a Net::StreamSocket, mangles it, and writes it to another Net::StreamSocket.

It needs to do so in real-time and without blocking. So I wanted to use a std::streambuf to move the data-through.

Has anyone done anything similar already?

I wanted to use a Net::SocketReactor to deliver read notifications of when I can read data from the source socket and append it to the streambuf, and use write notifications when I can write some or all of the buffered data to the destination socket.

Thanks.
philipp
 
Posts: 16
Joined: 08 Dec 2011, 03:59

Re: Plumbing StreamSockets to std::streambuf

Postby philipp » 12 Apr 2012, 01:03

Actually, I was thinking about this some more, and what's really needed is a "soft" pipe abstraction, that can be used to implement a buffered pipe used by two threads within the same process, for example. The 'producer' would write data into the pipe, and the 'consumer' would read it from the same.

There could be primitives to query the pipe how much unread data it holds, as well as how much space remains before blocking and/or having a 'short write' to the pipe.

Would this be derived from a BasicBufferedStreamBuf?
philipp
 
Posts: 16
Joined: 08 Dec 2011, 03:59


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest