Discussion board Search: 
Remember me Registration (Optional)
Forums -> General questions -> Converting Mediator Script(s) to Ruby
Reply | New topic

wipitgood

Postings: 4
Newcomer
          
Converting Mediator Script(s) to Ruby 04-08-2007 21:31
As an exercise in learning Ruby, I am going to try to covert all the related Mediator scripts. In looking through the code in Mediate.php I noticed that a non-blocking socket is opened (line 153), but the code that actually uses $sock is commented out. My question is: If $sock is used, where is it used as I can't find a reference to it in any of the other .php files.

If I can get the Mediator functionality working in Ruby I will more than happy to donate it to Wippien!

Thanks for any assistance that you can provide!
Reply with quote

kreso

Postings: 1534
Administrator
          
Re: Converting Mediator Script(s) to Ruby 04-08-2007 22:53
I would strongly suggest you find some XMPP implementation in Ruby, and then go into converting mediator. Going that low to socket level, you would need first to implement (good?) XMPP class which is big deal for itself.

If you find XMPP support for Ruby, converting mediator.php is really easy..

Or you were referring to UDP sockets? If so, you need to open UDP socket and accept connections on predefined port. How you plan to do it in Ruby I really don't know, but I will be happy to give any hints I can.

Kreso
Reply with quote

wipitgood

Postings: 4
Newcomer
          
Re: Converting Mediator Script(s) to Ruby 05-08-2007 00:56
I have found a couple of XMPP libraries for Ruby so that shouldn't be a problem. Based on your response, I am going to assume that the mediation is done via Jabber and not the UDP socket that is created on line 153 of Mediate.php since the socket isn't actually used for communication between the clients. If this assumption is wrong please let me know.

If I get the Ruby version working than I will also create a Perl and/or a Python version.

Quote:
I would strongly suggest you find some XMPP implementation in Ruby, and then go into converting mediator. Going that low to socket level, you would need first to implement (good?) XMPP class which is big deal for itself.

If you find XMPP support for Ruby, converting mediator.php is really easy..

Or you were referring to UDP sockets? If so, you need to open UDP socket and accept connections on predefined port. How you plan to do it in Ruby I really don't know, but I will be happy to give any hints I can.

Kreso

Reply with quote

kreso

Postings: 1534
Administrator
          
Re: Converting Mediator Script(s) to Ruby 15-08-2007 01:58
I got back from the vacation, so if you need help I can do it now. How far did you go with Ruby version?

Kreso
Reply with quote

wipitgood

Postings: 4
Newcomer
          
Re: Converting Mediator Script(s) to Ruby 17-08-2007 14:23
I got sidetracked on another project, but will be picking the ruby script up next week! The Jabber libraries for Ruby are very good and provide an easy messaging callback for message processing. I may need your assistance to confirm the handshake logic.

Thanks!
Reply with quote

KwukDuck

Anonymous
          
Re: Converting Mediator Script(s) to Ruby 20-08-2007 17:10
Wipitgood,

what is the idea of a ruby mediator?

what are the pros and cons?

will it give an executable server for windows environment? i'd love to see that.
Reply with quote

wipitgood

Newcomer
          
Re: Converting Mediator Script(s) to Ruby 20-08-2007 20:01
Quote:
Wipitgood,

what is the idea of a ruby mediator?

what are the pros and cons?

will it give an executable server for windows environment? i'd love to see that.


The main reason I am going with Ruby is that 1) I want to learn the language and 2)There is a good xmpp library (xmpp4r) that should make the conversion a tad easier. Also, in regards to your last point, I will be using the RubyScript2exe tool which transforms Ruby scripts into a standalone, compressed Windows, Linux or Mac OS X (Darwin) executable
Reply with quote

KwukDuck

Anonymous
          
Re: Converting Mediator Script(s) to Ruby 30-08-2007 15:44
nice wipit, im looking forward to it :)
Reply with quote
 
contact
Kresimir Petric, Croatia
Sjenjak 121 | HR-31000 Osijek


email | support@wippien.com