From: Mohammad --- Date: 2006-10-17T10:48:40+09:00 Subject: Re: UDP Server 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/.