Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8516d1f76512
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 34e940dfc17d
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Oct 5, 2016

  1. Copy the full SHA
    3abac97 View commit details
  2. Merge pull request #4203 from etehtsea/refactor-server-socket

    Get rid of code dup in ServerSocket#bind
    headius authored Oct 5, 2016
    Copy the full SHA
    34e940d View commit details
Showing with 1 addition and 14 deletions.
  1. +1 −14 core/src/main/java/org/jruby/ext/socket/RubyServerSocket.java
15 changes: 1 addition & 14 deletions core/src/main/java/org/jruby/ext/socket/RubyServerSocket.java
Original file line number Diff line number Diff line change
@@ -97,20 +97,7 @@ public IRubyObject connect(ThreadContext context, IRubyObject arg) {

@JRubyMethod()
public IRubyObject bind(ThreadContext context, IRubyObject addr) {
final InetSocketAddress iaddr;

if (addr instanceof Addrinfo) {
Addrinfo addrInfo = (Addrinfo) addr;
if (!addrInfo.ip_p(context).isTrue()) {
throw context.runtime.newTypeError("not an INET or INET6 address: " + addrInfo);
}
iaddr = new InetSocketAddress(addrInfo.getInetAddress().getHostAddress(), addrInfo.getPort());
} else {
iaddr = Sockaddr.addressFromSockaddr_in(context, addr);
}

doBind(context, getChannel(), iaddr, 0);
return RubyFixnum.zero(context.runtime);
return bind(context, addr, RubyFixnum.zero(context.runtime));
}

@JRubyMethod()