diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 23:08:39 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 23:08:39 +0000 |
commit | 12979424515344460afb12002ce07b670bf7cd6f (patch) | |
tree | 2d85f664a0fb708e459a30c56738487948ced8f9 /ext/socket/lib | |
parent | 39e112f89a4e7471bb95ec516b05c75ac6df5aa9 (diff) | |
download | ruby-12979424515344460afb12002ce07b670bf7cd6f.tar.gz |
* ext/socket: Make Socket documentation appear. Add documentation for
Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert.
[Ruby 1.9 - Feature #5182]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/lib')
-rw-r--r-- | ext/socket/lib/socket.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index d5201ef788..e7ae0a4db5 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -712,17 +712,28 @@ class Socket < BasicSocket # UDP/IP address information used by Socket.udp_server_loop. class UDPSource + # +remote_adress+ is an Addrinfo object. + # + # +local_adress+ is an Addrinfo object. + # + # +reply_proc+ is a Proc used to send reply back to the source. def initialize(remote_address, local_address, &reply_proc) @remote_address = remote_address @local_address = local_address @reply_proc = reply_proc end - attr_reader :remote_address, :local_address - def inspect + # Address of the source + attr_reader :remote_address + + # Local address + attr_reader :local_address + + def inspect # :nodoc: "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>" end + # Sends the String +msg+ to the source def reply(msg) @reply_proc.call msg end |