Skip to content
Discussion options

You must be logged in to vote

Many thanks, this helps a lot!

Before i could use only a buffer of about 3.000 measurement data sets, now a buffer of 12.000 sets is possible.

I have done it like this

# generator function for chunks of a bytearray 
def bytearrayChunk(bytearr,size):
    count = 0
    while True:
        start = count * size
        chunk = bytearr[start:start+size]  # small chunks to avoid out of memory errors
        count = count + 1
        if chunk:
            yield chunk
        else:  # empty chunk means end of the file
            return

the response part:

        startline = 'HTTP/1.0 200 OK\r\n'
        headers = 'Content-type: application/octet-stream\r\n\r\n'
        firstPacket = True
      …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@DavesCodeMusings
Comment options

@luxlux
Comment options

Answer selected by luxlux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants