}
public static InetSocketAddress addressFromArg(ThreadContext context, IRubyObject arg) {
InetSocketAddress iaddr;
if (arg instanceof Addrinfo) {
Addrinfo addrinfo = (Addrinfo)arg;
iaddr = new InetSocketAddress(addrinfo.getInetAddress(), addrinfo.getPort());
} else {
iaddr = addressFromSockaddr_in(context, arg);
}
return iaddr;