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: a6e4a53161e1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bf87a0bdf82d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 21, 2016

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df27afa View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf87a0b View commit details
Original file line number Diff line number Diff line change
@@ -21,11 +21,14 @@
import org.jruby.truffle.language.SafepointAction;
import org.jruby.truffle.language.backtrace.Backtrace;
import org.jruby.truffle.language.backtrace.BacktraceFormatter;
import org.jruby.truffle.language.control.JavaException;
import org.jruby.truffle.tools.simpleshell.SimpleShell;
import org.jruby.truffle.util.StringUtils;

import java.io.IOException;
import java.io.OutputStream;
import java.net.BindException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.List;

@@ -40,12 +43,15 @@ public class InstrumentationServerManager {
public InstrumentationServerManager(RubyContext context, int port) {
this.context = context;

final InetAddress host = InetAddress.getLoopbackAddress();
HttpServer server = null;

try {
server = HttpServer.create(new InetSocketAddress(port), 0);
server = HttpServer.create(new InetSocketAddress(host, port), 0);
} catch (BindException e) {
System.err.println("Port " + port + " was already in use: " + e);
throw new JavaException(e);
} catch (IOException e) {
e.printStackTrace();
throw new JavaException(e);
}

this.server = server;