greg.kujawa
6/29/2006 1:58:00 PM
msoulier wrote:
> Tim Hunter wrote:
> > > Perl and Python don't seem to have this problem. As a newbie to Ruby
> > > (hey, that rhymes), I find this rather frustrating.
> > www.ruby-doc.org
>
> Doesn't cut it.
>
> For example, in the UDPSocket class, there is no mention of the send
> method, but I'm told that it's there. That's just useless.
>
> Mike
Are you sure that the #send method isn't there? FYI here are some
details regarding the UDPSocket class...
UDPSocket
UDP socket class
UDPSocket is a class for UDP (User Datagram Protocol), which is
connection-less, unreliable protocol.
Required Library
require 'socket'
Inherited Class
IPSocket
Class Methods
UDPSocket::new([socktype=Socket::AF_INET])
UDPSocket::open([socktype=Socket::AF_INET])
Creates a UDP datagram socket.
Instance Methods
s.bind(host, port)
Binds the socket to port on host. host may be empty string ("") for
INADDR_ANY, or "<broadcast>" for INADDR_BROADCAST.
s.connect(host, port)
Connects the socket to port on host. host may be empty string ("") for
INADDR_ANY, or "<broadcast>" for INADDR_BROADCAST.
s.send(mesg, flags[, to])
s.send(mesg, flags[, host, port])
Sends data on a socket s, returning the length of the data sent. If
only two arguments are specified, the destination is assumed to be the
port of the existing connection. Otherwise, it may be specified using a
struct sockaddr when calling the method with three arguments, or by
indicating host and port when specifying four arguments.