issue with writing transform plugin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

issue with writing transform plugin

Gaurav Bansal
hi all,

We are writing a transform plugin where we get the data from server and copying the data to the output_buffer as follows :       
TSIOBufferCopy(output_buffer, TSVIOReaderGet(write_vio), towrite, 0);

Then after doing some checks on the data, we want to send some data (only some data of output_buffer on which checks have been performed) in output_buffer to the client. For this, we are using following api.
TSVIO TSVConnWrite(TSVConn connp, TSCont contp, TSIOBufferReader readerp, int64_t nbytes)       

We are finding one problem with the usage of above api. By using above api, all the data in output_buffer is send back to the client while we want only a portion of output_buffer (that portion on which the checks have been performed so far) to be sent to client. Is there any similar api where we can specify the offset & length of the data to be sent to client. OR is there some other better way to handle this ? We could have taken another buffer to store the incoming data and then after performing checks, write only that data to the output_buffer which we want to send to the client. But we want to avoid using a new buffer.

can anyone please help me solve the above problem ?
thanks,
gaurav
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with writing transform plugin

Nick Kew
On Fri, 2017-06-16 at 10:15 +0530, Gaurav Bansal wrote:

> Then after doing some checks on the data, we want to send some data
> (only some data of output_buffer on which checks have been performed)
> in output_buffer to the client.

Are you perhaps looking for TSVIONBytesSet on your output buffer?

The stream-editor plugin I recently mentioned in response to
another question would be one place to see usage, as it
meticulously manages bytes-out vs bytes-in in the context
of editing a data stream.

--
Nick Kew

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with writing transform plugin

Gaurav Bansal
Thanks Nick Kew for the info. Will have a look at your stream-editor plugin and get back.

On Fri, Jun 16, 2017 at 2:30 PM, Nick Kew <[hidden email]> wrote:
On Fri, 2017-06-16 at 10:15 +0530, Gaurav Bansal wrote:

> Then after doing some checks on the data, we want to send some data
> (only some data of output_buffer on which checks have been performed)
> in output_buffer to the client.

Are you perhaps looking for TSVIONBytesSet on your output buffer?

The stream-editor plugin I recently mentioned in response to
another question would be one place to see usage, as it
meticulously manages bytes-out vs bytes-in in the context
of editing a data stream.

--
Nick Kew


Loading...