Skip to content

Instantly share code, notes, and snippets.

@jlg
Created January 20, 2011 11:24
Show Gist options
  • Select an option

  • Save jlg/787762 to your computer and use it in GitHub Desktop.

Select an option

Save jlg/787762 to your computer and use it in GitHub Desktop.
import java.net.ServerSocket;
import py4j.GatewayServer;
public class AddrInUseTest {
public AddrInUseTest() {};
public static void main(String[] args) throws Exception {
int port = 25333;
// bind to port
ServerSocket sSocket = new ServerSocket(port);
// this should thorw BindException
GatewayServer.turnLoggingOn();
GatewayServer gatewayServer = new GatewayServer(new AddrInUseTest(), port, 1000, 1000);
gatewayServer.start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment