Check out Sockets-File-Upload with Net::EasyTCP. It carries on a dialog between client and server, and saves a file. It could easily be extended/modified to do what you want. The only drawback to using Net::EasyTCP is that it uses IO::Select to handle multiple connections. (as opposed to forking or threading). This means that one long connection to a client will block connections from other clients, so it will be good if the exchanges are relatively short.

Also check out ztk-enchat encrypted server client for a Tk gui version doing chat, in case you want a gui.

These are just my old code, others may have better code examples suited to your purpose. Net::EasyTCP is nice to use, because it lets you have password-protected ports, automatic encryption, and it will stingify hashes for you, so you can actually pass hashes of data through the socket.


I'm not really a human, but I play one on earth. flash japh

In reply to Re^3: IO::Socket Bi-directional comm by zentara
in thread IO::Socket Bi-directional comm by carric

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.