Chris and I have been working on the design for our networking plugin (which
may or may not end up being included in any of the CS/CEL repositories;
we'll discuss that at a later date) and I've come across a couple of design
questions I'd like to hear thoughts on. One of my goals in this design is to
allow the networking plugin to be used in as many projects as possible, so
we're trying to abstract any parts which people might want to change or
replace.


The biggest question currently is how to tie the network receive loop into
the API. There's a few approaches to this:
 - have functions in the connection class for all the operations needed by
the loop, and leave the loop's implementation and thread creation up to the
app (nice because the app designer has complete control over how threading
is done)
 - implement the loop in the network plugin and have callback hooks in the
API to handle incoming packets
 - implement the loop in the network plugin and generate CS events to handle
incoming packets

I personally like the last option the best (generating CS events based on
incoming packets) but I could see the merit of a callback system as well.
Would it be worth making the receive loop a separate interface so that part
can be swapped out depending on the user's needs? This would allow users to
substitute a networking loop with a different behavior depending on their
application's needs.


The other question we had come across (which we've already pretty much
decided on, but would like to pass by the mailing list) is how we want to
work the networking loop. Again, we have a couple of possibilities:
 - run a separate thread which keeps calling accept()
 - catch CS's idle events or frame events or something, and call accept() in
a non-blocking fashion (problem: it makes network performance directly
dependent on framerate)

It will need to be structured around CS's event loop, so our thought was
that using CS's thread support may be the best option here.


Any thoughts?

Thanks,
-- 
David H. Bronke
Vice President of Project Development
G33X Nexus Entertainment
http://www.g33xnexus.com/

v3sw5/7Hhw5/6ln4pr6Ock3ma7u7+8Lw3/7Tm3l6+7Gi2e4t4Mb7Hen5g8+9ORPa22s6MSr7p6
hackerkey.com
Support Web Standards! http://www.webstandards.org/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to