in reply to Sockets! Controlling Receiver part

ali_kerem,

I asked these 2 questions on PM and showed some code. Question 1 and Question 2.

Other monks had interesting comments and code samples. Maybe some of the comments or samples will set you on the correct course.

I finally used a technique where I packed the length into the first 4 bytes of the message and then did a 'recv' for that exact amount of data. I tested the technique up to about 64K without losing any information, but I didn't use partial reads.

The application was a key/value database and I wanted to share the core engine between multiple clients. The final solution had the clients(my code) save the value into the database and then send the key to the DB engine. Performance was very good and worked great in multi-core environment. The client good could save a 4GB blob while the DB engine provided indexing for the key.

Look at the comments about 'binmode' which may save you the conversion to/from hex.

Good Luck and Regards...Ed

"Well done is better than well said." - Benjamin Franklin

Replies are listed 'Best First'.
Re^2: Sockets! Controlling Receiver part
by ali_kerem (Acolyte) on Jun 27, 2013 at 11:34 UTC

    Thanks for the reply.

    I started to test it out, I'll try to implement it on the working code if my tests succeed.