Sha256: 5bed9d77abcb0afb8ed86f1e44e009bbbb1b36cad0a130a8ef31ad002cf4ad9d

Contents?: true

Size: 576 Bytes

Versions: 6

Compression:

Stored size: 576 Bytes

Contents

module RubySL
  module Socket
    module Foreign
      class SockaddrIn6 < Rubinius::FFI::Struct
        config("rbx.platform.sockaddr_in6", :sin6_family, :sin6_port,
               :sin6_flowinfo, :sin6_addr, :sin6_scope_id)

        def self.with_sockaddr(addr)
          pointer = Foreign.memory_pointer(addr.bytesize)
          pointer.write_string(addr, addr.bytesize)

          new(pointer)
        end

        def family
          self[:sin6_family]
        end

        def to_s
          pointer.read_string(self.class.size)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysl-socket-2.2.1 lib/rubysl/socket/foreign/sockaddr_in6.rb
rubysl-socket-2.2 lib/rubysl/socket/foreign/sockaddr_in6.rb
rubysl-socket-2.1.3 lib/rubysl/socket/foreign/sockaddr_in6.rb
rubysl-socket-2.1.2 lib/rubysl/socket/foreign/sockaddr_in6.rb
rubysl-socket-2.1.1 lib/rubysl/socket/foreign/sockaddr_in6.rb
rubysl-socket-2.1.0 lib/rubysl/socket/foreign/sockaddr_in6.rb