Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unchecked exceptions when launching 2 copies of opsu! #119

Closed
chong601 opened this issue Aug 13, 2015 · 5 comments
Closed

Unchecked exceptions when launching 2 copies of opsu! #119

chong601 opened this issue Aug 13, 2015 · 5 comments

Comments

@chong601
Copy link

When launching the 2nd opsu!, the application will immediately displays an error message:
Error message
Stack trace:

Another program is already running on port 49250.
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
    at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at itdelatrisu.opsu.Opsu.main(Opsu.java:119)

It will be proper if the application just output a JOptionPane.showMessageBox() with a message stating there's another copy of opsu! running.

Also, is it possible to have opsu! running at a higher port than the current one? I can't get it to work at my college because there's application using that port specifically for "phoning-home" to the main server for system-related telemetry

@itdelatrisu
Copy link
Owner

What if the other program running on the port isn't opsu?

You can change the port in the config file. 49250 is an ephemeral port, so I also don't think there's any reason to change it...

@chong601
Copy link
Author

In the case the other app, it just shows up almost exactly the same message (probably different stack message, can't confirm it because i'm on semester break for now D:)

For now, i set it to 60000 and see what's what

@itdelatrisu
Copy link
Owner

Sorry, let me clarify -- I can't just display an error message like "Another copy of opsu! is already running." because it might be a different program that's using the port, and (as far as I know) you can't use native Java to determine if that's the case.

@chong601
Copy link
Author

oh that.
but, what if we make a detailed possible issues:

opsu! was unable to start because of these possible reasons:
- Another copy of opsu! is running. The application will now exit.
- Another application is using the port. In this case <procedures to changing the listening port>.

@itdelatrisu
Copy link
Owner

Okay, that sounds good. Will do, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants