[muscle] Re: peer-to-peer help intro

  • From: "Jeremy Friesner" <jaf@xxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Sat, 30 Apr 2005 13:53:20 PDT (-0700)

Hi Barry,

I'm not sure exactly what you have in mind -- MUSCLE doesn't have a ready-made 
"peer-to-peer API", but it does have the tools to make it easier to construct a 
peer-to-peer system.  Those tools include:

1) A central server (muscled) that can be used as a starting point... i.e. your 
clients can log in to the server to find out the IP addresses of other 
participating clients, and then use those IP addresses to contact the other 
clients directly

2) A message thread class (MessageTransceiverThread) that hides most of the 
networking details and lets you do peer-to-peer communication at a higher level 
(i.e. sending and receiving Message objects instead of byte streams, thereby 
avoiding the hassles of message fragmentation/reassembly, byte-gender, protocol 
extension, and other common pitfalls)

3) Lower-level APIs such as the MessageIOGateway class and the simplified 
networking API  functions in NetworkUtilityFunctions.cpp that let your code 
handle the basic networking tasks directly if you prefer not to have a separate 
I/O thread handle them on your behalf.

Let me know what it is you have in mind (i.e. what sort of application you want 
to create, what operating system(s) you want it to run on, what programming 
language(s) you want to write it in, etc) and I may be able to give you more 
specific help.

As for examples, here are two:

BeShare -- a Napster style file sharing program for BeOS (includes source code) 
   http://www.lcscanada.com/muscle/BeShareAndMuscle.html   (magazine article)
   http://www.lcscanada.com/jaf/beshare/index.html  (Web page)
   http://www.lcscanada.com/jaf/beshare/BeShare2.27.zip (source and BeOS 

FoxRabbitCarrot -- a very simple multiplayer game written using Qt, so it runs 
on Windows, Mac, and Linux.  The code is a bit out of date and the game isn't 
all that much fun, but it should do for an example.
   http://www.osnews.com/story.php=3Fnews=5Fid=3D1523          (magazine 
   http://www.lcscanada.com/jaf/FRC1.00b=5Fsource.tar.gz  (source code)
   http://www.lcscanada.com/jaf/FRC1.00b=5FOSX.tar.gz     (MacOS/X build)
   http://www.lcscanada.com/jaf/FRC1.00b=5FRHat.tar.gz     (Red Hat build)
   http://www.lcscanada.com/jaf/FRC1.00b=5FWin.zip            (Windows build)


> I've looked at the beginner's guide, the API, and
> searched through the "test" folder for how to do
> peer-to-peer calls.  Can someone please point me to
> the direction I need to be looking in terms of how-to
> or maybe a sample=3F  

Other related posts: