i'm trying to put together a proxy between the server end of a client/server application, and a code repository. the repository is on win32, the server on solaris. i thought i'd write a sockets-based app that would handle communications with a protocol somewhat like SMTP. you'll find some of the design details below.

the design is basically complete, although i haven't included all the info below. now it's time for the implementation... which is where i'm stuck. i have a functioning sockets client/server pair (that's the easy part.) i don't have gobs of time to get this implemented -- i'd like to have it finished this week. i know there are modules like POE and DFA, but i'm not at all familiar with them. is there some sample code out there i can model this after, or could someone please provide some? i just need a kickstart and i'm sure i can handle the rest. thanks in advance.

now, for the details. there are six basic operations the server can perform:

my state diagram looks like this:

init | V HELLO / | \ / | \ / | \ GET UNL PUT | | | V V V DATA-->EXIT<--DATA | V end

five of the commands (HELLO, GET, UNL, PUT, EXIT) have a similar state diagrams. here, B is 'begin', W is 'wait', S is 'success', and F is 'failure'. success returns 'OK', failure returns a detailed error message.

+---+ cmd +---+ +---+ | B |------>| W |---->| S | +---+ +---+ +---+ | | +---+ ------>| F | +---+

the DATA command is a bit different, as shown in it's diagram below.

+---+ DATA +---+ | B |------->| W | +---+ +---+ | | ------------ ----- | | +---+ | --------->| S | | | | +---+ V | | +---+ data +---+ -->+---+ | |------->| W | | F | +---+ +---+------->+---+

did i mention it's a bit like SMTP? here the DATA command is sent, followed by multiple lines of data, and a terminator. a success or failure message is generated.

please let me know if you need any more detail, or clarification.

~Particle *accelerates*


In reply to creating a state machine by particle

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.