Class: Vertx::DatagramPacket

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/datagram_packet.rb

Overview

A received datagram packet (UDP) which contains the data and information about the sender of the data itself.

Instance Method Summary (collapse)

Instance Method Details

- (::Vertx::Buffer) data

Returns the data of the Vertx::DatagramPacket

Returns:

Raises:

  • (ArgumentError)


29
30
31
32
33
34
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/datagram_packet.rb', line 29

def data
  if !block_given?
    return ::Vertx::Buffer.new(@j_del.java_method(:data, []).call())
  end
  raise ArgumentError, "Invalid arguments when calling data()"
end

- (::Vertx::SocketAddress) sender

Returns the SocketAddress of the sender that sent this Vertx::DatagramPacket.

Returns:

Raises:

  • (ArgumentError)


21
22
23
24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/datagram_packet.rb', line 21

def sender
  if !block_given?
    return ::Vertx::SocketAddress.new(@j_del.java_method(:sender, []).call())
  end
  raise ArgumentError, "Invalid arguments when calling sender()"
end