Top Fields Constructors Methods
org.jruby.ext.socket

public Class Addrinfo

extends RubyObject
Class Inheritance
Imports
jnr.constants.platform.AddressFamily, .NameInfo, .ProtocolFamily, .Sock, jnr.netdb.Protocol, .Service, jnr.unixsocket.UnixSocketAddress, org.jruby.Ruby, .RubyArray, .RubyBignum, .RubyClass, .RubyInteger, .RubyObject, .RubyString, org.jruby.anno.JRubyMethod, org.jruby.api.Define, org.jruby.runtime.Arity, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .TypeConverter, org.jruby.util.io.Sockaddr, java.io.ByteArrayOutputStream, .DataOutputStream, .File, .IOException, java.net.Inet4Address, .Inet6Address, .InetAddress, .InetSocketAddress, .NetworkInterface, .SocketAddress, .UnknownHostException

Field Summary

Modifier and TypeField and Description
pack-priv final short
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
pack-priv final short
pack-priv final short
private boolean
private boolean
private String
private boolean
private boolean
private NetworkInterface
pack-priv final byte
private ProtocolFamily
private Protocol
private Sock
private SocketAddress
private SocketType
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
public
Addrinfo(Ruby runtime, RubyClass cls)

public
Addrinfo(Ruby runtime, RubyClass cls, NetworkInterface networkInterface, boolean isBroadcast)

public
Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress)

public
Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress, int port, Sock sock)

public
Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress, Sock sock, SocketType socketType)

public
Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress, Sock sock, SocketType socketType, boolean displaysCanonical)

public
Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress, int port)

public
Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress)

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
public IRubyObject
public static void
pack-priv AddressFamily
public static IRubyObject
public Inet4Address
public Inet6Address
public InetAddress
public InetSocketAddress
public IRubyObject
public IRubyObject
public IRubyObject
getnameinfo(ThreadContext context, int flags)

public int
private static InetAddress
private static InetAddress
private static InetAddress
public SocketAddress
public UnixSocketAddress
private short
private byte[]
public IRubyObject
initialize(ThreadContext context, IRubyObject _sockaddr)

public IRubyObject
initialize(ThreadContext context, IRubyObject _sockaddr, IRubyObject _family)

public IRubyObject
initialize(ThreadContext context, IRubyObject _sockaddr, IRubyObject _family, IRubyObject _socktype)

public IRubyObject
private void
initializeCommon(ThreadContext context, IRubyObject sockaddrArg, IRubyObject protocolFamilyArg, IRubyObject socketTypeArg, IRubyObject protocolArg)

private Addrinfo
initializeSimple(ThreadContext context, IRubyObject host, IRubyObject port, int socketType, int protocolFamily)

public IRubyObject
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

public IRubyObject
private String
public static IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
private String
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
private boolean
is_0001(byte[] raw)

private boolean
public IRubyObject
public IRubyObject
public String
public IRubyObject
public IRubyObject
private void
public IRubyObject
private int
private int
swapShortEndian(short i)

public static IRubyObject
public IRubyObject
public IRubyObject
public String
toString()

Overrides org.jruby.RubyObject.toString.

The default toString method is just a wrapper that calls the Ruby "to_s" method.

public static IRubyObject
public static IRubyObject
public static IRubyObject
public IRubyObject
public IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassgetNativeClassIndexhashCodeinspectop_eqqputsspecificEvaltoRubyString

Field Detail

AF_PACKETback to summary
pack-priv final short AF_PACKET
AI_ADDRCONFIGback to summary
public static final int AI_ADDRCONFIG
AI_ALLback to summary
public static final int AI_ALL
AI_CANONNAMEback to summary
public static final int AI_CANONNAME
AI_DEFAULTback to summary
public static final int AI_DEFAULT
AI_MASKback to summary
public static final int AI_MASK
AI_NUMERICHOSTback to summary
public static final int AI_NUMERICHOST
AI_NUMERICSERVback to summary
public static final int AI_NUMERICSERV
AI_PASSIVEback to summary
public static final int AI_PASSIVE
AI_V4MAPPEDback to summary
public static final int AI_V4MAPPED
AI_V4MAPPED_CFGback to summary
public static final int AI_V4MAPPED_CFG
ARPHRD_ETHERback to summary
pack-priv final short ARPHRD_ETHER
ARPHRD_LOOPBACKback to summary
pack-priv final short ARPHRD_LOOPBACK
displaysCanonicalback to summary
private boolean displaysCanonical
interfaceNameback to summary
private String interfaceName
isBroadcastback to summary
private boolean isBroadcast
looksLikeV4ButIsV6back to summary
private boolean looksLikeV4ButIsV6
networkInterfaceback to summary
private NetworkInterface networkInterface
PACKET_HOSTback to summary
pack-priv final byte PACKET_HOST
pfamilyback to summary
private ProtocolFamily pfamily
protocolback to summary
private Protocol protocol
sockback to summary
private Sock sock
socketAddressback to summary
private SocketAddress socketAddress
socketTypeback to summary
private SocketType socketType

Constructor Detail

Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, NetworkInterface networkInterface, boolean isBroadcast)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress, int port, Sock sock)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress, Sock sock, SocketType socketType)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress, Sock sock, SocketType socketType, boolean displaysCanonical)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, InetAddress inetAddress, int port)
Addrinfoback to summary
public Addrinfo(Ruby runtime, RubyClass cls, SocketAddress socketAddress)

Method Detail

afamilyback to summary
public IRubyObject afamily(ThreadContext context)
Annotations
@JRubyMethod
canonnameback to summary
public IRubyObject canonname(ThreadContext context)
Annotations
@JRubyMethod
createAddrinfoback to summary
public static void createAddrinfo(ThreadContext context, RubyClass Object)
getAddressFamilyback to summary
pack-priv AddressFamily getAddressFamily()
getaddrinfoback to summary
public static IRubyObject getaddrinfo(ThreadContext context, IRubyObject recv, IRubyObject[] args)
Annotations
@JRubyMethod
rest:true
meta:true
getInet4Addressback to summary
public Inet4Address getInet4Address()
getInet6Addressback to summary
public Inet6Address getInet6Address()
getInetAddressback to summary
public InetAddress getInetAddress()
getInetSocketAddressback to summary
public InetSocketAddress getInetSocketAddress()
getnameinfoback to summary
public IRubyObject getnameinfo(ThreadContext context)
Annotations
@JRubyMethod
getnameinfoback to summary
public IRubyObject getnameinfo(ThreadContext context, IRubyObject flags)
Annotations
@JRubyMethod
getnameinfoback to summary
public IRubyObject getnameinfo(ThreadContext context, int flags)
getPortback to summary
public int getPort()
getRubyInetAddressback to summary
private static InetAddress getRubyInetAddress(ThreadContext context, IRubyObject node)
getRubyInetAddressback to summary
private static InetAddress getRubyInetAddress(String node)
getRubyInetAddressback to summary
private static InetAddress getRubyInetAddress(String hostname, String node)
getSocketAddressback to summary
public SocketAddress getSocketAddress()
getUnixSocketAddressback to summary
public UnixSocketAddress getUnixSocketAddress()
hatypeback to summary
private short hatype()
hwaddrback to summary
private byte[] hwaddr()
initializeback to summary
public IRubyObject initialize(ThreadContext context, IRubyObject _sockaddr)
Annotations
@JRubyMethod
visibility:PRIVATE
initializeback to summary
public IRubyObject initialize(ThreadContext context, IRubyObject _sockaddr, IRubyObject _family)
Annotations
@JRubyMethod
visibility:PRIVATE
initializeback to summary
public IRubyObject initialize(ThreadContext context, IRubyObject _sockaddr, IRubyObject _family, IRubyObject _socktype)
Annotations
@JRubyMethod
visibility:PRIVATE
initializeback to summary
public IRubyObject initialize(ThreadContext context, IRubyObject[] args)
Annotations
@JRubyMethod
required:1
optional:3
checkArity:false
visibility:PRIVATE
initializeCommonback to summary
private void initializeCommon(ThreadContext context, IRubyObject sockaddrArg, IRubyObject protocolFamilyArg, IRubyObject socketTypeArg, IRubyObject protocolArg)
initializeSimpleback to summary
private Addrinfo initializeSimple(ThreadContext context, IRubyObject host, IRubyObject port, int socketType, int protocolFamily)
inspectback to summary
public IRubyObject inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.RubyBasicObject.inspect.

Returns a string containing a human-readable representation of obj. If not overridden, uses the to_s method to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"

Annotations
@JRubyMethod
inspect_sockaddrback to summary
public IRubyObject inspect_sockaddr(ThreadContext context)
Annotations
@JRubyMethod
inspectnameback to summary
private String inspectname()
ipback to summary
public static IRubyObject ip(ThreadContext context, IRubyObject recv, IRubyObject arg)
Annotations
@JRubyMethod
meta:true
ip_addressback to summary
public IRubyObject ip_address(ThreadContext context)
Annotations
@JRubyMethod
ip_pback to summary
public IRubyObject ip_p(ThreadContext context)
Annotations
@JRubyMethod
name:ip?
ip_portback to summary
public IRubyObject ip_port(ThreadContext context)
Annotations
@JRubyMethod
notImplemented:true
ip_unpackback to summary
public IRubyObject ip_unpack(ThreadContext context)
Annotations
@JRubyMethod
ipv4_loopback_pback to summary
public IRubyObject ipv4_loopback_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv4_loopback?
ipv4_multicast_pback to summary
public IRubyObject ipv4_multicast_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv4_multicast?
ipv4_pback to summary
public IRubyObject ipv4_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv4?
ipv4_private_pback to summary
public IRubyObject ipv4_private_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv4_private?
ipv6_ipback to summary
private String ipv6_ip()
ipv6_linklocal_pback to summary
public IRubyObject ipv6_linklocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_linklocal?
ipv6_loopback_pback to summary
public IRubyObject ipv6_loopback_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_loopback?
ipv6_mc_global_pback to summary
public IRubyObject ipv6_mc_global_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_mc_global?
ipv6_mc_linklocal_pback to summary
public IRubyObject ipv6_mc_linklocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_mc_linklocal?
ipv6_mc_nodelocal_pback to summary
public IRubyObject ipv6_mc_nodelocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_mc_nodelocal?
ipv6_mc_orglocal_pback to summary
public IRubyObject ipv6_mc_orglocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_mc_orglocal?
ipv6_mc_sitelocal_pback to summary
public IRubyObject ipv6_mc_sitelocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_mc_sitelocal?
ipv6_multicast_pback to summary
public IRubyObject ipv6_multicast_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_multicast?
ipv6_pback to summary
public IRubyObject ipv6_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6?
ipv6_sitelocal_pback to summary
public IRubyObject ipv6_sitelocal_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_sitelocal?
ipv6_to_ipv4back to summary
public IRubyObject ipv6_to_ipv4(ThreadContext context)
Annotations
@JRubyMethod
notImplemented:true
ipv6_unique_local_pback to summary
public IRubyObject ipv6_unique_local_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_unique_local?
ipv6_unspecified_pback to summary
public IRubyObject ipv6_unspecified_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_unspecified?
ipv6_v4compat_pback to summary
public IRubyObject ipv6_v4compat_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_v4compat?
ipv6_v4mapped_pback to summary
public IRubyObject ipv6_v4mapped_p(ThreadContext context)
Annotations
@JRubyMethod
name:ipv6_v4mapped?
is_0001back to summary
private boolean is_0001(byte[] raw)
isIPV6back to summary
private boolean isIPV6()
marshal_dumpback to summary
public IRubyObject marshal_dump(ThreadContext context)
Annotations
@JRubyMethod
notImplemented:true
marshal_loadback to summary
public IRubyObject marshal_load(ThreadContext context, IRubyObject arg)
Annotations
@JRubyMethod
notImplemented:true
packet_inspectback to summary
public String packet_inspect()
pfamilyback to summary
public IRubyObject pfamily(ThreadContext context)
Annotations
@JRubyMethod
protocolback to summary
public IRubyObject protocol(ThreadContext context)
Annotations
@JRubyMethod
setSockAndProtocolback to summary
private void setSockAndProtocol(Sock sock)
socktypeback to summary
public IRubyObject socktype(ThreadContext context)
Annotations
@JRubyMethod
swapIntEndianback to summary
private int swapIntEndian(int i)
swapShortEndianback to summary
private int swapShortEndian(short i)
tcpback to summary
public static IRubyObject tcp(ThreadContext context, IRubyObject recv, IRubyObject host, IRubyObject port)
Annotations
@JRubyMethod
meta:true
to_sockaddrback to summary
public IRubyObject to_sockaddr(ThreadContext context)
Annotations
@JRubyMethod
name:to_sockaddr, to_s
to_strback to summary
public IRubyObject to_str(ThreadContext context)
Annotations
@JRubyMethod
toStringback to summary
public String toString()

Overrides org.jruby.RubyObject.toString.

Doc from org.jruby.RubyObject.toString.

The default toString method is just a wrapper that calls the Ruby "to_s" method.

Returns:String

string representation

udpback to summary
public static IRubyObject udp(ThreadContext context, IRubyObject recv, IRubyObject host, IRubyObject port)
Annotations
@JRubyMethod
meta:true
unixback to summary
public static IRubyObject unix(ThreadContext context, IRubyObject recv, IRubyObject path)
Annotations
@JRubyMethod
meta:true
unixback to summary
public static IRubyObject unix(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject type)
Annotations
@JRubyMethod
meta:true
unix_pback to summary
public IRubyObject unix_p(ThreadContext context)
Annotations
@JRubyMethod
name:unix?
unix_pathback to summary
public IRubyObject unix_path(ThreadContext context)
Annotations
@JRubyMethod