るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.010秒)
トップページ > クエリ:write[x] > クラス:TCPServer[x]

別のキーワード

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

ライブラリ

検索結果

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