class Socket::UDPSource - Documentation for Ruby 4.1
Description: class Socket::UDPSource: IP address information used by Socket. udp_server_loop.
Keywords: ruby,class,Socket::UDPSource

🔍

No recent searches

# class Socket::UDPSource

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)
Source

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

`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.

### Public Instance Methods

reply (msg)
Source

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

Sends the `String` `msg` to the source