るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.125秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:-[x] > バージョン:2.5.0[x] > クエリ:write[x] > クラス:TCPServer[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

検索結果

TCPServer#accept -> TCPSocket (325.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"
}...