public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } });
public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } });
public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } });
public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } });
public static void createOption(Ruby runtime) { RubyClass addrinfo = runtime.getClass("Socket").defineClassUnder( "Option", runtime.getObject(), new ObjectAllocator() { public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } }); addrinfo.defineAnnotatedMethods(Option.class); }
public static void createOption(Ruby runtime) { RubyClass addrinfo = runtime.getClass("Socket").defineClassUnder( "Option", runtime.getObject(), new ObjectAllocator() { public IRubyObject allocate(Ruby runtime, RubyClass klazz) { return new Option(runtime, klazz); } }); addrinfo.defineAnnotatedMethods(Option.class); }
@JRubyMethod(name = "int", required = 4, meta = true) public static IRubyObject rb_int(ThreadContext context, IRubyObject self, IRubyObject[] args) { ProtocolFamily family = SocketUtils.protocolFamilyFromArg(args[0]); SocketLevel level = SocketUtils.levelFromArg(args[1]); SocketOption option = SocketUtils.optionFromArg(args[2]); ByteList data = packInt(RubyNumeric.fix2int(args[3])); return new Option(context.getRuntime(), family, level, option, data); }
@JRubyMethod(required = 4, meta = true) public static IRubyObject bool(ThreadContext context, IRubyObject self, IRubyObject[] args) { ProtocolFamily family = SocketUtils.protocolFamilyFromArg(args[0]); SocketLevel level = SocketUtils.levelFromArg(args[1]); SocketOption option = SocketUtils.optionFromArg(args[2]); ByteList data = packInt(args[3].isTrue() ? 1 : 0); return new Option(context.getRuntime(), family, level, option, data); }
@JRubyMethod(required = 4, meta = true) public static IRubyObject bool(ThreadContext context, IRubyObject self, IRubyObject[] args) { ProtocolFamily family = SocketUtils.protocolFamilyFromArg(args[0]); SocketLevel level = SocketUtils.levelFromArg(args[1]); SocketOption option = SocketUtils.optionFromArg(args[2]); ByteList data = packInt(args[3].isTrue() ? 1 : 0); return new Option(context.getRuntime(), family, level, option, data); }
@JRubyMethod(name = "int", required = 4, meta = true) public static IRubyObject rb_int(ThreadContext context, IRubyObject self, IRubyObject[] args) { ProtocolFamily family = SocketUtils.protocolFamilyFromArg(args[0]); SocketLevel level = SocketUtils.levelFromArg(args[1]); SocketOption option = SocketUtils.optionFromArg(args[2]); ByteList data = packInt(RubyNumeric.fix2int(args[3])); return new Option(context.getRuntime(), family, level, option, data); }
@JRubyMethod(meta = true) public static IRubyObject linger(ThreadContext context, IRubyObject self, IRubyObject vonoff, IRubyObject vsecs) { ProtocolFamily family = ProtocolFamily.PF_UNSPEC; SocketLevel level = SocketLevel.SOL_SOCKET; SocketOption option = SocketOption.SO_LINGER; int coercedVonoff; if (!TypeConverter.checkIntegerType(context, vonoff).isNil()) { coercedVonoff = vonoff.convertToInteger().getIntValue(); } else { coercedVonoff = vonoff.isTrue() ? 1 : 0; } ByteList data = packLinger(coercedVonoff, vsecs.convertToInteger().getIntValue()); return new Option(context.getRuntime(), family, level, option, data); }
@JRubyMethod(meta = true) public static IRubyObject linger(ThreadContext context, IRubyObject self, IRubyObject vonoff, IRubyObject vsecs) { ProtocolFamily family = ProtocolFamily.PF_UNSPEC; SocketLevel level = SocketLevel.SOL_SOCKET; SocketOption option = SocketOption.SO_LINGER; int coercedVonoff; if (!TypeConverter.checkIntegerType(context, vonoff).isNil()) { coercedVonoff = vonoff.convertToInteger().getIntValue(); } else { coercedVonoff = vonoff.isTrue() ? 1 : 0; } ByteList data = packLinger(coercedVonoff, vsecs.convertToInteger().getIntValue()); return new Option(context.getRuntime(), family, level, option, data); }
return new Option(runtime, ProtocolFamily.PF_INET, level, opt, packedValue);
return new Option(runtime, ProtocolFamily.PF_INET, level, opt, packedValue);
return new Option(runtime, ProtocolFamily.PF_INET, level, opt, value); } else { return number(runtime, SocketType.forChannel(channel).getSocketOption(channel, opt));
return new Option(runtime, ProtocolFamily.PF_INET, level, opt, value); } else { return number(runtime, SocketType.forChannel(channel).getSocketOption(channel, opt));