From: Jason Roelofs Date: 2006-10-17T22:44:40+09:00 Subject: Re: UDP Server ------=_Part_21100_11193514.1161092676891 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline http://www.google.com/search?q=rubygame As for network library, check out EventMachine: http://rubyforge.org/projects/eventmachine. It makes doing UDP/TCP connections and communication quite easy and much, much faster than pure Ruby can (written in C++). Jason On 10/16/06, Mohammad --- wrote: > > John Turner wrote: > > Mohammad --- wrote: > >> Alright I've been trying to set up a UDP server for my "Game", the > >> "Client" is in python, but I want a ruby server. I tried some code from > >> the Ruby book, but I wasn't able to get it to work. If someone could > >> please help me out with starting the server. BTW: port is 5555 > >> > > > > Code for just about the simplest of servers is below, should just print > > out all requests coming in from your python client if it's sending it > > correctly: > > > > require 'socket' > > serv = UDPSocket.open > > serv.bind(nil, 5555) #first param is hostname, nil works fine. > > loop{puts serv.recv(5555)} > > > > If it doesn't work then you should probably test to make sure your > > python client is actually sending things correctly. > > Thanks alot now I can get started on a server. :D also how would I get > the address also, the reasson why I decided to do the game in python > instead of ruby was beacause there is a libary called "PyGame" which is > just a another handler for open SDL(is that it? the graphics?) anyway is > there one for ruby there's still time for me to change the language > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_21100_11193514.1161092676891--