On Aug 26, 2005, at 12:40, Abhishek Jain wrote:
Dear Friends,
I have a task to do.I need to send SMS using SMPP protocol .It is a
'Application Layer TCP protocol'.
I do understand POE but never had a chance to implement a protocol.
Can anyone here suggest me how to do so , I mean how to create packets
etc.I do have a document of SMPP available at www.smsforum.net
<http://www.smsforum.net/> .Also I would be using multi-tasking so
Want
to use POE.
Creating packets is not hard. Your operating system takes care of
all the layers below "application" for you.
First you need to understand how applications transfer information.
I recommend finding a simple protocol (for example POP3), reading the
relavent documentation, and using telnet to interact with a server.
SMPP may be simple enough, but I've never used it and can't recommend
it either way.
All "stream" protocols work the same. The sender translates
structured data into a format that can be sent across a socket. The
act of translating data like this is called "serialization". The
receiver parses inbound streams back into structured data it can
use. POE::Filter classes have a generic interface to perform these
actions so they can be plugged into client and server applications.
Is the answer lies in that I will have to create a Filter or so. If
yes
give me a Hint and if possible a small demo.
You can't begin to write a filter until you understand the protocol.
If you don't know how an SMPP client and server talk to each other,
then you can't begin to write one (or the other) yourself.
There is already an implementation of SMPP via NET::SMPP but I am not
sure that whether it is applicable for multitasking also.
I need to create a client and a server .
Anyone here having a clue or a tutorial Please tell me.
I shall be very grateful.
Aside from their constructors, filters have four methods:
The two easiest are probably get_one_start() and get_pending().
get_one_start() places raw data from a socket into the filter's
parsing buffer. get_pending() retrieves any unused data from the
filter's parsing buffer. See the source for them in
POE::Filter::Line; they're only two or three lines long.
The put() method is next in line of difficulty. It takes one or more
structured data packets and returns the same number of serialized
data chunks, ready to be sent across a socket. It should be easy to
write a put() method once you know how to perform the serialization
for your protocol.
get_one() is probably the hardest method to write. It parses data
from the filter's parsing buffer, returning zero or more complete
data structures. This performs the task commonly known as
deserializing, thawing, or cooking.
Your filter is done once you have written those four methods. The
real work comes after that: Documenting, writing tests, and releasing
your code on the CPAN.
--
Rocco Caputo - [EMAIL PROTECTED]