summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-22 01:24:28 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-22 01:24:28 +0000
commit1a40be09d635c4b35008877c3fdf10c963e08641 (patch)
tree2bb199f72191d33917be4dcdbc5e210b4962e09f
parent062780c83434a54e2c0d79a0530168e3a045f872 (diff)
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/socket/lib/socket.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 74f29a3..5b74381 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -58,14 +58,14 @@ class Addrinfo
# The socket is returned otherwise.
#
# Addrinfo.tcp("www.ruby-lang.org", 80).connect_from("0.0.0.0", 4649) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
+ # s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
+ # puts s.read
# }
#
# # Addrinfo object can be taken for the argument.
# Addrinfo.tcp("www.ruby-lang.org", 80).connect_from(Addrinfo.tcp("0.0.0.0", 4649)) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
+ # s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
+ # puts s.read
# }
#
def connect_from(*local_addr_args, &block)
@@ -78,8 +78,8 @@ class Addrinfo
# The socket is returned otherwise.
#
# Addrinfo.tcp("www.ruby-lang.org", 80).connect {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
+ # s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
+ # puts s.read
# }
#
def connect(&block)
@@ -92,8 +92,8 @@ class Addrinfo
# The socket is returned otherwise.
#
# Addrinfo.tcp("0.0.0.0", 4649).connect_to("www.ruby-lang.org", 80) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
+ # s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
+ # puts s.read
# }
#
def connect_to(*remote_addr_args, &block)
@@ -220,9 +220,9 @@ class Socket < BasicSocket
# If no block is given, the socket is returned.
#
# Socket.tcp("www.ruby-lang.org", 80) {|sock|
- # sock.print "GET / HTTP/1.0\r\n\r\n"
+ # sock.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
# sock.close_write
- # print sock.read
+ # puts sock.read
# }
#
def self.tcp(host, port, local_host=nil, local_port=nil) # :yield: socket