W3cubDocs

/Ruby 2.4

class Socket::UDPSource

Parent:
Object

UDP/IP address information used by Socket.udp_server_loop.

Attributes

local_address[R]

Local address

remote_address[R]

Address of the source

Public Class Methods

new(remote_address, local_address, &reply_proc) Show source

remote_address is an Addrinfo object.

local_address is an Addrinfo object.

reply_proc is a Proc used to send reply back to the source.

# File ext/socket/lib/socket.rb, line 1022
def initialize(remote_address, local_address, &reply_proc)
  @remote_address = remote_address
  @local_address = local_address
  @reply_proc = reply_proc
end

Public Instance Methods

reply(msg) Show source

Sends the String msg to the source

# File ext/socket/lib/socket.rb, line 1039
def reply(msg)
  @reply_proc.call msg
end

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.