Package org.jruby.ext.socket
Class SocketUtils
java.lang.Object
org.jruby.ext.socket.SocketUtils
Socket class methods for addresses, structures, and so on.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static jnr.constants.platform.AddressFamilyaddressFamilyFromArg(IRubyObject domain) static voidbuildAddrinfoList(ThreadContext context, IRubyObject[] args, SocketUtils.AddrinfoCallback callback) static IRubyObjectgetaddress(ThreadContext context, IRubyObject hostname) static IRubyObjectgetaddrinfo(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)getaddrinfoList(ThreadContext context, IRubyObject[] args) private static StringgetHostAddress(ThreadContext context, InetAddress addr, Boolean reverse) static IRubyObjectgethostbyaddr(ThreadContext context, IRubyObject[] args) static IRubyObjectgethostbyname(ThreadContext context, IRubyObject hostname) static IRubyObjectgethostname(ThreadContext context) static IRubyObjectgetnameinfo(ThreadContext context, IRubyObject[] args) static intgetPortFrom(ThreadContext context, IRubyObject _port) static InetAddressgetRubyInetAddress(byte[] addressBytes) static InetAddressgetRubyInetAddress(String addressString) static InetAddressgetRubyInetAddress(String host, String node) static InetAddress[]getRubyInetAddresses(String addressString) static InetAddress[]getRubyInetAddresses(ByteList address) Deprecated.static IRubyObjectgetservbyname(ThreadContext context, IRubyObject[] args) static IRubyObjectip_address_list(ThreadContext context) (package private) static jnr.constants.platform.SocketLevellevelFromArg(IRubyObject level) (package private) static jnr.constants.platform.SocketOptionoptionFromArg(IRubyObject opt) static IRubyObjectpack_sockaddr_in(ThreadContext context, IRubyObject port, IRubyObject host) Deprecated.static IRubyObjectpack_sockaddr_un(ThreadContext context, IRubyObject filename) Deprecated.static intportToInt(IRubyObject port) (package private) static jnr.constants.platform.ProtocolFamilyprotocolFamilyFromArg(IRubyObject protocol) (package private) static jnr.netdb.ProtocolprotocolFromArg(IRubyObject protocol) static RuntimeExceptionstatic RuntimeExceptionsockerr_with_trace(Ruby runtime, String msg, StackTraceElement[] trace) (package private) static jnr.constants.platform.SocksockFromArg(IRubyObject type) private static InetAddressspecialAddress(String addressString) static RubyArrayunpack_sockaddr_in(ThreadContext context, IRubyObject addr) Deprecated.
-
Field Details
-
STRING_IPV4_ADDRESS_PATTERN
-
IPV4_HOST_GROUP
private static final int IPV4_HOST_GROUP- See Also:
-
IPV4_PORT_GROUP
private static final int IPV4_PORT_GROUP- See Also:
-
BROADCAST
- See Also:
-
INADDR_BROADCAST
private static final byte[] INADDR_BROADCAST -
ANY
- See Also:
-
INADDR_ANY
private static final byte[] INADDR_ANY
-
-
Constructor Details
-
SocketUtils
public SocketUtils()
-
-
Method Details
-
gethostname
-
gethostbyaddr
-
getservbyname
-
pack_sockaddr_in
@Deprecated public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject port, IRubyObject host) Deprecated. -
unpack_sockaddr_in
Deprecated. -
pack_sockaddr_un
Deprecated. -
gethostbyname
-
getaddrinfo
Ruby definition would look like: def self.getaddrinfo(host, port, family = nil, socktype = nil, protocol = nil, flags = nil, reverse_lookup = nil) -
getaddrinfoList
-
buildAddrinfoList
public static void buildAddrinfoList(ThreadContext context, IRubyObject[] args, SocketUtils.AddrinfoCallback callback) -
getnameinfo
-
ip_address_list
-
getRubyInetAddresses
@Deprecated public static InetAddress[] getRubyInetAddresses(ByteList address) throws UnknownHostException Deprecated.- Throws:
UnknownHostException
-
getRubyInetAddresses
- Throws:
UnknownHostException
-
getRubyInetAddress
- Throws:
UnknownHostException
-
getRubyInetAddress
- Throws:
UnknownHostException
-
getRubyInetAddress
- Throws:
UnknownHostException
-
specialAddress
- Throws:
UnknownHostException
-
getaddress
-
sockerr
-
sockerr_with_trace
public static RuntimeException sockerr_with_trace(Ruby runtime, String msg, StackTraceElement[] trace) -
getPortFrom
-
getHostAddress
-
addressFamilyFromArg
-
sockFromArg
-
protocolFamilyFromArg
-
protocolFromArg
-
levelFromArg
-
optionFromArg
-
portToInt
-