るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.074秒)

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. tuple write
  5. stringio write

ライブラリ

クラス

検索結果

UNIXServer#accept -> UnixSocket (18136.0)

クライアントからの接続要求を accept(2)で待ち受け、接続した UNIXSocket のインスタンスを返します。

...トからの接続要求を accept(2)で待ち受け、接続した
UNIXSocket のインスタンスを返します。

例:

require 'socket'

UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
s = serv.accept
s.write "from server"
c.write "from client"
p c.recv...

TCPServer#accept -> TCPSocket (18114.0)

クライアントからの接続要求を受け付け、接続した TCPSocket のインスタンスを返します。

...クライアントからの接続要求を受け付け、接続した
TCPSocket のインスタンスを返します。

例:

require 'socket'

TCPServer.open("", 0) {|serv|
c = TCPSocket.new(*serv.addr.values_at(3,1))
s = serv.accept
c.write "foo"
p s.recv(10) #=> "foo"
}...

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...ます。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックと一緒に呼びだされたときは
エンティ...
....html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...ます。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックと一緒に呼びだされたときは
エンティ...
....html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...