News:

  • September 30, 2026, 11:27:51 PM

Login with username, password and session length

Author Topic: Copying string to a byte array  (Read 25069 times)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Copying string to a byte array
« Reply #15 on: August 12, 2019, 07:14:15 AM »
I think ?chunks? in this context is referring to chunked file encoding. Chunked encoding gets used when the entire payload size isn?t known in advance, like is a multi-part database query, so the size is provided progressively in each piece sent. When sending a file where the length is known, chunked encoding isn?t necessary.

This is not the same thing as streaming the file 1k or 50k bytes at a time, or TCP?s packetizing.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Copying string to a byte array
« Reply #16 on: August 12, 2019, 11:22:18 AM »
The client or server on the other end does not see how many "chunks" you are sending on the wire. The TCP protocol is packaging everything up and sending it in pieces anyway. 
It sounds like you may be complicating something that is actually pretty simple (been there done that).

If you need more header information, then let me know.
I do have more information stored away somewhere.

Thanks for the assistance plcnut. I'll reach out if I need more info.

I think ?chunks? in this context is referring to chunked file encoding. Chunked encoding gets used when the entire payload size isn?t known in advance, like is a multi-part database query, so the size is provided progressively in each piece sent. When sending a file where the length is known, chunked encoding isn?t necessary.

This is not the same thing as streaming the file 1k or 50k bytes at a time, or TCP?s packetizing.

You're right Bob. The reason I went for chunked encoding was because I wasn't able to send the entire file in one go with HTTPCMD, because the buffer wouldn't be big enough. If I use STREAMOUT instead I can just use the Content-Length header and stream it in one go. This would be easier than what I have now.

I'll update once I've got it sorted.
Andrew.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Copying string to a byte array
« Reply #17 on: August 12, 2019, 11:25:53 AM »
You're right Bob. The reason I went for chunked encoding was because I wasn't able to send the entire file in one go with HTTPCMD, because the buffer wouldn't be big enough. If I use STREAMOUT instead I can just use the Content-Length header and stream it in one go. This would be easier than what I have now.

I'll update once I've got it sorted.
Andrew.

Clearly the easiest would be if HTTPCMD could send a file. ;) It was just more complexity than we wanted to dig into at the time, so we made provision in the instruction to add it in the future, just haven't gotten back to it.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO