Top Description Inners Fields Constructors Methods
org.jruby.ext.socket

public Class SocketUtils

extends Object
Class Inheritance
Imports
jnr.constants.platform.AddressFamily, .ProtocolFamily, .Sock, .SocketLevel, .SocketOption, jnr.netdb.Protocol, .Service, org.jruby.Ruby, .RubyArray, .RubyBasicObject, .RubyClass, .RubyInteger, .RubyNumeric, .RubyString, .RubySymbol, org.jruby.api.Access, org.jruby.ast.util.ArgsUtil, org.jruby.exceptions.RaiseException, org.jruby.runtime.Helpers, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .TypeConverter, org.jruby.util.io.Sockaddr, java.net.Inet4Address, .Inet6Address, .InetAddress, .InetSocketAddress, .NetworkInterface, .SocketException, .UnknownHostException, java.util.ArrayList, .Enumeration, .List, java.util.regex.Matcher, .Pattern

Socket class methods for addresses, structures, and so on.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final byte[]
private static final byte[]
public static final String
private static final int
private static final int
private static final String
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static AddressFamily
public static void
buildAddrinfoList(ThreadContext context, IRubyObject[] args, boolean processLastArgAsReverse, SocketUtils.AddrinfoCallback callback)

public static IRubyObject
public static IRubyObject
getaddrinfo(final ThreadContext context, IRubyObject[] args)

Ruby definition would look like:

def self.getaddrinfo(host, port, family = nil, socktype = nil, protocol = nil, flags = nil, reverse_lookup = nil)

public static List<Addrinfo>
private static String
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static int
public static InetAddress
getRubyInetAddress(String addressString)

public static InetAddress
public static InetAddress
getRubyInetAddress(byte[] addressBytes)

public static InetAddress[]
getRubyInetAddresses(ByteList address)
Deprecated

public static InetAddress[]
public static IRubyObject
public static IRubyObject
public static boolean
pack-priv static SocketLevel
pack-priv static SocketOption
public static IRubyObject
pack_sockaddr_in(ThreadContext context, IRubyObject port, IRubyObject host)
Deprecated

public static IRubyObject
pack_sockaddr_un(ThreadContext context, IRubyObject filename)
Deprecated

public static int
portToInt(IRubyObject port)
Deprecated since 10.0.

public static int
pack-priv static ProtocolFamily
pack-priv static Protocol
public static RuntimeException
sockerr(Ruby runtime, String msg)

public static RuntimeException
pack-priv static Sock
private static InetAddress
specialAddress(String addressString)

public static RubyArray<T extends IRubyObject>
unpack_sockaddr_in(ThreadContext context, IRubyObject addr)
Deprecated

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANYback to summary
private static final String ANY
BROADCASTback to summary
private static final String BROADCAST
INADDR_ANYback to summary
private static final byte[] INADDR_ANY
INADDR_BROADCASTback to summary
private static final byte[] INADDR_BROADCAST
IP_V4_MAPPED_ADDRESS_PREFIXback to summary
public static final String IP_V4_MAPPED_ADDRESS_PREFIX
IPV4_HOST_GROUPback to summary
private static final int IPV4_HOST_GROUP
IPV4_PORT_GROUPback to summary
private static final int IPV4_PORT_GROUP
ipv6LocalHostback to summary
private static final String ipv6LocalHost
STRING_IPV4_ADDRESS_PATTERNback to summary
private static final Pattern STRING_IPV4_ADDRESS_PATTERN

Constructor Detail

SocketUtilsback to summary
public SocketUtils()

Method Detail

addressFamilyFromArgback to summary
pack-priv static AddressFamily addressFamilyFromArg(ThreadContext context, IRubyObject domain)
buildAddrinfoListback to summary
public static void buildAddrinfoList(ThreadContext context, IRubyObject[] args, boolean processLastArgAsReverse, SocketUtils.AddrinfoCallback callback)
getaddressback to summary
public static IRubyObject getaddress(ThreadContext context, IRubyObject hostname)
getaddrinfoback to summary
public static IRubyObject getaddrinfo(final ThreadContext context, IRubyObject[] args)

Ruby definition would look like:

def self.getaddrinfo(host, port, family = nil, socktype = nil, protocol = nil, flags = nil, reverse_lookup = nil)
getaddrinfoListback to summary
public static List<Addrinfo> getaddrinfoList(ThreadContext context, IRubyObject[] args)
getHostAddressback to summary
private static String getHostAddress(ThreadContext context, InetAddress addr, Boolean reverse)
gethostbyaddrback to summary
public static IRubyObject gethostbyaddr(ThreadContext context, IRubyObject[] args)
gethostbynameback to summary
public static IRubyObject gethostbyname(ThreadContext context, IRubyObject hostname)
gethostnameback to summary
public static IRubyObject gethostname(ThreadContext context)
getnameinfoback to summary
public static IRubyObject getnameinfo(ThreadContext context, IRubyObject[] args)
getPortFromback to summary
public static int getPortFrom(ThreadContext context, IRubyObject _port)
getRubyInetAddressback to summary
public static InetAddress getRubyInetAddress(String addressString) throws UnknownHostException
getRubyInetAddressback to summary
public static InetAddress getRubyInetAddress(String host, String node) throws UnknownHostException
getRubyInetAddressback to summary
public static InetAddress getRubyInetAddress(byte[] addressBytes) throws UnknownHostException
getRubyInetAddressesback to summary
public static InetAddress[] getRubyInetAddresses(ByteList address) throws UnknownHostException

Deprecated

Annotations
@Deprecated
getRubyInetAddressesback to summary
public static InetAddress[] getRubyInetAddresses(String addressString) throws UnknownHostException
getservbynameback to summary
public static IRubyObject getservbyname(ThreadContext context, IRubyObject[] args)
ip_address_listback to summary
public static IRubyObject ip_address_list(ThreadContext context)
isIPV4MappedAddressPrefixback to summary
public static boolean isIPV4MappedAddressPrefix(String address)
levelFromArgback to summary
pack-priv static SocketLevel levelFromArg(ThreadContext context, IRubyObject level)
optionFromArgback to summary
pack-priv static SocketOption optionFromArg(ThreadContext context, IRubyObject opt)
pack_sockaddr_inback to summary
public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject port, IRubyObject host)

Deprecated

Annotations
@Deprecated
pack_sockaddr_unback to summary
public static IRubyObject pack_sockaddr_un(ThreadContext context, IRubyObject filename)

Deprecated

Annotations
@Deprecated
portToIntback to summary
public static int portToInt(IRubyObject port)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
portToIntback to summary
public static int portToInt(ThreadContext context, IRubyObject port)
protocolFamilyFromArgback to summary
pack-priv static ProtocolFamily protocolFamilyFromArg(ThreadContext context, IRubyObject protocol)
protocolFromArgback to summary
pack-priv static Protocol protocolFromArg(ThreadContext context, IRubyObject protocol)
sockerrback to summary
public static RuntimeException sockerr(Ruby runtime, String msg)
sockerr_with_traceback to summary
public static RuntimeException sockerr_with_trace(Ruby runtime, String msg, StackTraceElement[] trace)
sockFromArgback to summary
pack-priv static Sock sockFromArg(ThreadContext context, IRubyObject type)
specialAddressback to summary
private static InetAddress specialAddress(String addressString) throws UnknownHostException
unpack_sockaddr_inback to summary
public static RubyArray<T extends IRubyObject> unpack_sockaddr_in(ThreadContext context, IRubyObject addr)

Deprecated

Annotations
@Deprecated
org.jruby.ext.socket back to summary

pack-priv Interface SocketUtils.AddrinfoCallback


Method Summary

Modifier and TypeMethod and Description
public void
addrinfo(InetAddress address, int port, Sock sock, Boolean reverse, boolean usesCanonical)

Method Detail

addrinfoback to summary
public void addrinfo(InetAddress address, int port, Sock sock, Boolean reverse, boolean usesCanonical)