when /\AGARR\t(.+)/ # Get ARRay
Anything between the two forward slashes indicates the usage of regular expression, which I'm sure you understand. \A means "start match at the very beginning of the string". \t is obvious tab. Anything in parentheses will be matched and can be accessed using $1, $2, etc. The period followed by a plus-sign means to match one or more of any character. There are plenty of tutorials about regular expressions, like this one:
http://forum.chaos-project.com/index.php/topic,56.htmlWhen we make this call, we are sending this string to the server:
If we run this through our regular expression, GARR\t will be matched. The 1 will be caught within the (.+), which we can then access with $1.
So we sent a message to the server, but now we need to send the message back to the client(s).
client.send('GARR', value)
The variable 'client' is passed through the
self.client_update method, which pretty much is our Socket object. Again, we're sending a string that will look something like this back to the client:
Our clients need to be able to interpret this message, hence the class RMXOS::Network aliased method.
---
All communication done between the client and server is through string-based messages. You start with some kind of identifier (e.g. GARR) that will then run a specific block of code to parse the remaining information appended to the message (if any). I suggest you get a solid understanding of regular expressions before you tackle this any further. I also suggest studying the RMX-OS plug-ins in the database until you can understand what is actually being done.
It would also help tremendously if you took a class on computer communications--everything made perfect sense to me. I was a prominent Ruby scripter of 4 years before taking the class, but RMX-OS was still a giant enigma to me.