MUSCLE has been developed, used, and refined as the networking component of BeShare, CueConsole, CueStation, and various other audio control applications at Level Control Systems (now Meyer Sound Laboratories) for over six years.
It allows (n) client programs (each of which may be running on a separate computer and/or under a different OS) to communicate with each other in a many-to-many message-passing style.
It employs a central server to which client programs may connect or disconnect at any time (This design is similar to other client-server systems such as Quake servers, IRC servers, and Napster servers, but more general in application).
In addition to the client-server system, MUSCLE contains classes to support peer-to-peer message streaming connections, as well as some handy miscellaneous utility classes.
As distributed, the server side of the software is ready to compile and run, but to do much with it you'll want to write your own client software. Example client software can be found in the "test" subdirectory.
Here are some key features of "Muscle":
· Powerful: Provides a centralized "message crossbar server" for up to (n) simultaneous client programs to connect to. (n is limited only by the OS's FD_SET size--typically 1024 or higher).
· Easy: All communication is done over TCP, by sending flattened Message objects (which are very similar to BeOS's BMessages, except portable to any OS) through MessageIOGateways. Under most popular programming environments, it's even easier--see item 8.
· Efficient: Messages sent to the server may be broadcasted to all connected clients, or multicasted intelligently using pattern-matching and/or boolean filtering logic.
· Portable: All code (except for some platform-specific convenience classes in the support folders) uses only standard C++ and BSD socket calls, and should compile and run under any modern OS with minimal changes. All code has been compiled and tested on BeOS, Red Hat Linux, SUSE Linux, QNX, Yellow Dog Linux, AtheOS, FreeBSD, NetBSD, MacOS/X, Windows 98, Windows 2000, and Windows XP.
· Flexible: Clients may store data (in the form of Messages) in the server's RAM, using a filesystem-like node hierarchy. Other clients may "subscribe" to this server-side data, and the server will then automatically send them updates to the data as it is changed. Subscriptions are also specified via wildcarding, for maximum flexibility. Server-side filtering of results using boolean tests of their content is also supported.
· Open: All source code is licensed under the BSD Open Source License, and is freely distributable and usable for any purpose. The source code contains many useful classes, including platform-neutral analogs to Be's BMessage, BDataIO, BFlattenable, and BString classes. In addition, the archive also includes handy double-ended-queue, Hashtable, Reference-counting, and "I/O gateway" classes.
· Customizable: All server-side session handlers are implemented by subclassing a standard interface (AbstractReflectSession) so that they can be easily augmented or replaced with custom logic. Message serialization and low-level I/O is handled in a similar fashion, making it easy to replace the byte-stream format or transport mechanism with your own.
· Convenient: For selected environments, including Windows, BeOS, Qt, Java, Delphi, and Python, special utility classes are provided to hide the synchronous TCP messaging interface behind an asynchronous send-and-receive-messages API that's easier to deal with.
· Use BMessage-like muscle::Messages under any operating system.
· Send flattened muscle::Messages from one computer to another over TCP streams, eliminating unnecessary compatibility and protocol-versioning hassles.
· Run a "muscled server" on a central machine, and write (or download) client programs to log in to the server and communicate through it. Once logged in, client programs can discover who else is logged in, send muscle::Messages to other clients, and store muscle::Messages in the server's RAM for other clients to download later. Clients can also "subscribe" to selected data on the server, and be automatically notified whenever it changes. Unicast-style, multicast-style, and broadcast-style Message routing are all supported via an intelligent hierarchical pattern-matching routing mechanism. Writing multiplayer games, IRC style chat applications, SETI style distributed calculation apps, or any other type of distributed software is made easy because MUSCLE handles all the dirty work for you!
· Customize the included "muscled server" by defining your own session logic or message-streaming protocol. (Note that this is only necessary for certain specialized applications--the standard server provides sufficient functionality for most things)
· Write your client code in C++, C, Java, Delphi, or Python. Single-threaded and multi-threaded messaging APIs are provided for all of the aforementioned languages.
· Or just use the included message, string, dataIO, hashtable, dequeue, string-tokenizer, reference-count, regular expression and pattern matching parser, and object-pool code by themselves, as handy cross-platform utility classes. All source code is included, and you are free to use and abuse it any way you wish.
What's New in This Release: [ read full changelog ]
· Optimized CreateConnectedSocketPair() by having it use the UNIX socketpair(AF_UNIX) function on systems that support that call.
· Removed the optional (useNagles) argument from the CreateConnectedSocketPair() function, since there is little or no point in using Nagles algorithm for sockets within the same process. (if you really needed it for some reason, you could still call SetSocketNaglesAlgorithmEnabled() manually on the resulting sockets afterwards)
· tests/cvscopy.cpp is now tests/svncopy.cpp, since I don't use CVS anymore.
· Thread::WaitForNextMessageAux() wasn't handling file descriptors properly when called with a wakeupTime less than or equal to the current time. Fixed.
· Added a testpulsenode.cpp file to the tests folder, to test the reliability and scalability of the PulseNode timed-event-callback implementation.
· Fixed some valgrind hits in NetworkUtilityFunctions.cpp by having the code check the sin_family of sockaddr structs before reading any IPv4-specific fields.
· QMuscleSupport.h wouldn't compile under Qt 3.x. Fixed.
· Added Mika Lindqvist's patches to get QMuscleSupport.h to compile under older versions of Microsoft Visual C .
· The SharedUsageLimitProxyMemoryAllocator class was not always freeing all of the cached memory during large free operations, which could result in the process-memory-cache getting too large. Fixed.
· Fixed a bug in the PulseNode class's linked list code that could cause PulseChildren to not have their Pulse() methods called at the proper times.
· Merged in Bryan Varner's patch to the MessageTransceiverThread Java class so that spurious connect-succeeded tags are no longer sent by the I/O thread to the main thread.