Hi ,

Could you please give me some suggestions? I would like to create a small buffer in my code because the memory of the hardware is quite small. If so, it can't receive all of the data that I send. Sometimes, the data are over write. How should I solve that problem? Please show to me the sample one.

Thanks,
zawpai

Read them chunk by chunk, process it that way. Each packet can be broken into multiple chunks and preocessed.

Only solution is send small chunks of data, as big as you can keep in your buffer.
Prepare a queue at sending side(client side) send data to your hardware(server) only from that queue.
Hardware is the limiting factor. Your application has to work with the limitations imposed by the hardware.

Dear all,

Thank you for giving me the suggestions. Sorry for replying lately because the previous 4 days are holidays. If so, I seldom to use my PC.
I will try to write in my code. If I get the problem while I am writing them, I will let you know. If anyone have some sample code, I would like to see it because I am finding the way which one is easier for me.

Best wishes,

zawpai

Looked at your post again, and I feel that you could come up with the solution for this using the UNIX socket Sever/Client Arch. Perhaps something similar to dudeyprateek.

What you have to is run server, where is will just accept the connection from the client get the data from the client and keep on buffering the server. The server is the only contact point to your hardware. The server will keep on checking the buffer in the hardware to make sure that if it can accept any data, IF yes then you get a chunk of data from your buffer on the server and send them across to the hardware buffer. But the server will still keep on getting data from the client.

This way you can buffer the data on your machine.

> If anyone have some sample code
Its quite a lot of code to post it here. Have a go with this. See what you get along.

ssharish

This article has been dead for over six months. Start a new discussion instead.