protected SocketAddress getSocketAddress() { Channel channel = getOpenChannel(); return SocketType.forChannel(channel).getLocalSocketAddress(channel); }
protected SocketAddress getSocketAddress() { Channel channel = getChannel(); return SocketType.forChannel(channel).getLocalSocketAddress(channel); }
protected SocketAddress getSocketAddress() { Channel channel = getOpenChannel(); return SocketType.forChannel(channel).getLocalSocketAddress(channel); }
protected InetSocketAddress getRemoteSocket() throws BadDescriptorException { Channel channel = getOpenChannel(); return (InetSocketAddress)SocketType.forChannel(channel).getRemoteSocketAddress(channel); }
protected SocketAddress getSocketAddress() { Channel channel = getChannel(); return SocketType.forChannel(channel).getLocalSocketAddress(channel); }
protected InetSocketAddress getSocketAddress() throws BadDescriptorException { Channel channel = getOpenChannel(); return (InetSocketAddress)SocketType.forChannel(channel).getLocalSocketAddress(channel); }
protected InetSocketAddress getRemoteSocket() throws BadDescriptorException { Channel channel = getOpenChannel(); return (InetSocketAddress)SocketType.forChannel(channel).getRemoteSocketAddress(channel); }
protected InetSocketAddress getSocketAddress() throws BadDescriptorException { Channel channel = getOpenChannel(); return (InetSocketAddress)SocketType.forChannel(channel).getLocalSocketAddress(channel); }
@JRubyMethod(compat = CompatVersion.RUBY1_9) public IRubyObject remote_address(ThreadContext context) { try { InetSocketAddress address = getRemoteSocket(); if (address == null) { return context.nil; } else { return new Addrinfo(context.runtime, context.runtime.getClass("Addrinfo"), address.getAddress(), address.getPort(), SocketType.forChannel(getChannel())); } } catch (BadDescriptorException bde) { throw context.runtime.newErrnoEBADFError("address unavailable"); } }
@JRubyMethod(compat = CompatVersion.RUBY1_9) public IRubyObject local_address(ThreadContext context) { try { InetSocketAddress address = getSocketAddress(); if (address == null) { return context.nil; } else { return new Addrinfo(context.runtime, context.runtime.getClass("Addrinfo"), address.getAddress(), address.getPort(), SocketType.forChannel(getChannel())); } } catch (BadDescriptorException bde) { throw context.runtime.newErrnoEBADFError("address unavailable"); } }
protected SocketAddress getRemoteSocket() { Channel channel = getOpenChannel(); SocketAddress address = SocketType.forChannel(channel).getRemoteSocketAddress(channel); if (address == null) throw getRuntime().newErrnoENOTCONNError(); return address; }
@JRubyMethod(compat = CompatVersion.RUBY1_9) public IRubyObject remote_address(ThreadContext context) { try { InetSocketAddress address = getRemoteSocket(); if (address == null) { return context.nil; } else { return new Addrinfo(context.runtime, context.runtime.getClass("Addrinfo"), address.getAddress(), address.getPort(), SocketType.forChannel(getChannel())); } } catch (BadDescriptorException bde) { throw context.runtime.newErrnoEBADFError("address unavailable"); } }
@JRubyMethod(compat = CompatVersion.RUBY1_9) public IRubyObject local_address(ThreadContext context) { try { InetSocketAddress address = getSocketAddress(); if (address == null) { return context.nil; } else { return new Addrinfo(context.runtime, context.runtime.getClass("Addrinfo"), address.getAddress(), address.getPort(), SocketType.forChannel(getChannel())); } } catch (BadDescriptorException bde) { throw context.runtime.newErrnoEBADFError("address unavailable"); } }
protected SocketAddress getRemoteSocket() { Channel channel = getOpenChannel(); SocketAddress address = SocketType.forChannel(channel).getRemoteSocketAddress(channel); if (address == null) throw getRuntime().newErrnoENOTCONNError(); return address; }
channel = fptr.channel(); try { SocketType.forChannel(channel).shutdownInput(channel); channel = fptr.channel(); try { SocketType.forChannel(channel).shutdownOutput(channel);
channel = fptr.channel(); try { SocketType.forChannel(channel).shutdownInput(channel); channel = fptr.channel(); try { SocketType.forChannel(channel).shutdownOutput(channel);
@JRubyMethod public IRubyObject local_address(ThreadContext context) { Ruby runtime = context.runtime; InetSocketAddress address = getInetSocketAddress(); if (address != null) { SocketType socketType = SocketType.forChannel(getChannel()); return new Addrinfo(runtime, runtime.getClass("Addrinfo"), address, socketType.getSocketType(), socketType); } UnixSocketAddress unix = getUnixSocketAddress(); return Addrinfo.unix(context, runtime.getClass("Addrinfo"), runtime.newString(unix.path())); }
@JRubyMethod public IRubyObject local_address(ThreadContext context) { Ruby runtime = context.runtime; InetSocketAddress address = getInetSocketAddress(); if (address != null) { SocketType socketType = SocketType.forChannel(getChannel()); return new Addrinfo(runtime, runtime.getClass("Addrinfo"), address, socketType.getSocketType(), socketType); } UnixSocketAddress unix = getUnixSocketAddress(); return Addrinfo.unix(context, runtime.getClass("Addrinfo"), runtime.newString(unix.path())); }
@JRubyMethod public IRubyObject remote_address(ThreadContext context) { Ruby runtime = context.runtime; InetSocketAddress address = getInetRemoteSocket(); if (address != null) { SocketType socketType = SocketType.forChannel(getChannel()); return new Addrinfo(runtime, runtime.getClass("Addrinfo"), address, socketType.getSocketType(), socketType); } UnixSocketAddress unix = getUnixRemoteSocket(); if (unix != null) { return Addrinfo.unix(context, runtime.getClass("Addrinfo"), runtime.newString(unix.path())); } throw runtime.newErrnoENOTCONNError(); }
@JRubyMethod public IRubyObject remote_address(ThreadContext context) { Ruby runtime = context.runtime; InetSocketAddress address = getInetRemoteSocket(); if (address != null) { SocketType socketType = SocketType.forChannel(getChannel()); return new Addrinfo(runtime, runtime.getClass("Addrinfo"), address, socketType.getSocketType(), socketType); } UnixSocketAddress unix = getUnixRemoteSocket(); if (unix != null) { return Addrinfo.unix(context, runtime.getClass("Addrinfo"), runtime.newString(unix.path())); } throw runtime.newErrnoENOTCONNError(); }