48件ヒット
[1-48件を表示]
(0.074秒)
クラス
-
Net
:: HTTP (24) - TCPServer (12)
- UNIXServer (12)
検索結果
先頭4件
-
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...