Re: [gmime-devel] stream parsing from network



Hi Kane,

On 6/30/2016 1:56 PM, Kane Kim wrote:
I want to integrate with gmime from another language (go). I want to read message content from network and stream it to gmime. It's easy to accumulate whole message in a buffer and then use mem stream. What's best way to avoid doing that and send to gmime in chunks?

What you'll want to do is subclass GMimeStream and write a custom stream that reads the next block of data from the network when the parser calls g_mime_stream_read() (which means you'll want to override the read method).

You don't need to implement a write method unless you intend on writing to it, but you'll need to implement seek (just make it return -1 to say it doesn't support seeking).

Hope that helps,

Jeff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]