class UDPSocket

UDPSocketクラス ↑

UDP/IPのデータグラム型ソケットを制御するクラス

Public Class Methods

new() click to toggle source
コンストラクタ
UDPSocketオブジェクトを生成する。

Args ↑

Return ↑

生成されたUDPSocketオブジェクト

Exception ↑

# File socket.rb, line 98
def initialize()
end

Public Instance Methods

bind(host, port) click to toggle source
ソケットのbind
UDPソケットを指定のソケットにbindする。

Args ↑

host bindするIPアドレスまたはホスト名 ↑

port bindするポート番号 ↑

Return ↑

nil

Exception ↑

# File socket.rb, line 109
def bind(host, port)
  nil
end
connect(host, port) click to toggle source
ソケットのconnect
UDPソケットの送信先を指定する。

Args ↑

host 送信先のIPアドレスまたはホスト名 ↑

port 送信先のポート番号 ↑

Return ↑

nil

Exception ↑

# File socket.rb, line 121
def connect(host, port)
  nil
end
recv(maxlen) click to toggle source
ソケットデータ受信
UDPソケットからデータを受信し文字列として返す。

Args ↑

maxlen 受信データの最大長 ↑

Return ↑

受信データ文字列

Exception ↑

IOError 通信エラー ↑

# File socket.rb, line 133
def recv(maxlen)
  ""
end
send(mesg) click to toggle source
ソケットデータ送信
UDPソケットへ文字列データを送信する。

Args ↑

mesg 送信データ文字列 ↑

Return ↑

送信データ長

Exception ↑

IOError 通信エラー ↑

# File socket.rb, line 145
def send(mesg)
  mesg.length
end