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


In reply to Re: Sockets! Controlling Receiver part by flexvault
in thread Sockets! Controlling Receiver part by ali_kerem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.