[Spread-users] C# Issues

Goran Hasse gorhas at gmail.com
Mon Mar 15 13:28:24 EDT 2010


Hello,

I think you mess upp two fundamental concepts here.
Transport and application protocol.
The spread bus is a transport, sort of "tcp-multicast". This is NOT an
application
protocol. You have to define this yourself. XML is a good starting point. In
XML you have a start tag and then you could look for an end tag. But you should
always test your application by sending fractions of your application
protocol over
the transport channel. The important thing is then that the transport
deliver all
bytes and deliver them in order along with information on how many bytes
are delevered. Then you can assamble your packet until you have a complete
one. So your packet should NOT be droped or lost. This is what the
transport should garantee.

Read
http://www.rfc-editor.org/rfc/rfc3117.txt
and
http://beepcore.org/mrose_beep.html

I personaly like the paragaph; ;-)

"Unfortunately, most application protocol design has not enjoyed as
excellent a history as TCP. Engineers design protocols the way monkeys
try to get to the moon that is, by climbing a tree, looking around,
and finding another tree to climb. Perhaps this is because there are
more distractions at the application layer. For example, as far as TCP
is concerned, its sole reason for being is to provide a full-duplex
octet-aligned pipe in a robust and network-friendly fashion. The
natural result is that while TCP's philosophy is built around
"reliability through retransmission," there isn't a common mantra at
the application layer."

Cordially yours
Göran Hasse

P.S.
We are about to release a nice opensource SCADA system where spread is
one component.
http://www.freescada.com/
The system is 95% complete. ;-)
I hope you will find some of the concepts in this system interesting.


2010/3/14 Energy Keeper <energy.keeper at gmail.com>:
> Hello,
>
> I've recently been informed of the spread toolkit, and I look forward to
> developing on top of it for a few client / server projects I've been wanting
> to get into. I plan to write a GUI front end in C#, and Use perl for the
> server side data accessors in conjunction with DBD::Pg and POE. However my
> knowledge of C# is somewhat limited compared to perl. I'm still
> uncomfortable with the language, and I have much to learn. (Which is why I'm
> using spread, and not socket programing myself).
>
> The API is poorly documented, or if its really well documented then I'm
> really missing something.
>
> I need to know exactly, how do I send and receive messages? The
> SpreadMessage Constructor takes no arguments, and is not overloaded. Nor
> does a SpreadMessage Object have any properties or methods to define a
> message, or message data.
>
> What I think, is he right way to do this is to send messages as XML so I can
> implement some form of checking to ensure no packets were droped / lost. So
> I need "some method" that returns a SpreadMessage Object that I can then
> throw into SpreadConnection.Milticast.
>
> Something like this:
> [code=csharp]
> namespace SpreadClient
> {
>        // This is held in a TabControl.TabPage
>        // New Tabs are created for each joined group.
>        // We will implement methods to send only to
>        // our group, and all groups.
>        public partial class SPMsg : UserControl
>        {
>                 SpreadConnection conn;
>                 SpreadGroup group;
>
>                 public SPMsg ( SpreadConnection c, SpreadGroup g )
>                 {
>                          this.conn = c;
>                          this.group = g;
>                          InitializeComponent();
>                 }
>                public void SendMsg(string xmldata)
>                {
>                        conn.Mulicast(
>                                MsgMaker.Msg(xmldata));
>                }
>        }
> }
>
> Of course other things need to be implemented as well like message recievers
> and such. But I think I can use events for that, since the Spread Lib comes
> with a few delegates that handle that. Anyway, My methods probably aren't
> the best. And anyone that can offer help, or a better way to skin this cat,
> I would be greatly appreciative.
>
> _______________________________________________
> Spread-users mailing list
> Spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users
>
>



-- 
gorhas at gmail.com
Mob: 070-5530148




More information about the Spread-users mailing list