Class: Socket::UDPSource (Ruby 2.7.3)
Description: Class : Socket::UDPSource - Ruby 2.7.3

### Home Classes Methods

### In Files

- socket/lib/socket.rb

### Parent

Object

### Methods

- ::new
- #reply

### Class/Module Index

Quicksearch

- Addrinfo
- BasicSocket
- IPSocket
- Object
- SOCKSSocket
- Socket
- Socket::AncillaryData
- Socket::Constants
- Socket::Ifaddr
- Socket::Option
- Socket::UDPSource
- SocketError
- TCPServer
- TCPSocket
- UDPSocket
- UNIXServer
- UNIXSocket

No matching classes.

# 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) click to toggle 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 socket/lib/socket.rb, line 1039
    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) click to toggle source

Sends the String `msg` to the source

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