89件ヒット
[1-89件を表示]
(0.015秒)
種類
- インスタンスメソッド (48)
- 文書 (29)
- クラス (12)
クラス
-
Net
:: HTTP (24) - TCPServer (12)
- UNIXServer (12)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) - TCPServer (12)
- get (24)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 5 feature (12)
検索結果
先頭5件
-
UNIXServer
# accept -> UnixSocket (18135.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 (18113.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"
}... -
ruby 1
. 6 feature (30.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...イプの dup を close_write するとエラーになっていました。
((<ruby-dev:17155>))
open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex I......2002-03-01) [i586-linux]
"\302\200"
[0]
=> ruby 1.6.7 (2002-05-04) [i586-linux]
"\302\200"
[128]
: 2002-04-11: IO#write
ソケットやパイプに対する EPIPE の検出に失敗することがありました。
((<ruby-dev:16849>))
: 2002-04-11: ((<"cgi/se......((<ruby-bugs-ja:PR#85>))
# server
require 'socket'
File.unlink("/tmp/sss")
sock = UNIXServer.new("/tmp/sss").accept
# client
require 'socket'
sock = UNIXSocket.new("/tmp/sss").addr
=> ["AF_UNIX", "\031((\306\031(\010"]
=>... -
NEWS for Ruby 3
. 0 . 0 (24.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = p......nvoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822......sform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other rela... -
TCPServer (24.0)
-
TCP/IP ストリーム型接続のサーバ側のソケットのクラスです。
...n nsock[0]
if s == gs
socks.push(s.accept)
print(s, " is accepted\n")
else
if s.eof?
print(s, " is gone\n")
s.close
socks.delete(s)
else
str = s.gets
s.write(str)
end
end
end
end
Thread......addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
Thread.start(gs.accept) do |s| # save to dynamic variable
print(s, " is accepted\n")
while s.gets
s.write($_)
end
print(s, " is gone\n")
s.close
end
end... -
ruby 1
. 8 . 5 feature (24.0) -
ruby 1.8.5 feature ruby 1.8.4 から ruby 1.8.5 までの変更点です。
...]
#: UNIXSocket#recvfrom_nonblock [new]
: TCPServer#accept_nonblock [new]
: UNIXServer#accept_nonblock [new]
((<ruby-core:7925>))
=== 2006-05-22
: IO#read_nonblock [new]
: IO#write_nonblock [new]
: Socket#connect_nonblock [new]
: Socket#accept_nonblock [new]
: Socket#recvfrom_nonblock [new]... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (12.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 (12.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...