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: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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |