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

JVM_Bind on simple target connection try #3

Open
romanman opened this issue Sep 24, 2014 · 6 comments
Open

JVM_Bind on simple target connection try #3

romanman opened this issue Sep 24, 2014 · 6 comments

Comments

@romanman
Copy link

Hey guys ,

Thanks for glorious lib,
some small problem I am trying to establish simple
hole punching, for that I have started mediator
on some server and trying to connect to it by
that code:

        UnsecureTargetSideConnectionEstablishment utsce = new UnsecureTargetSideConnectionEstablishment();
        utsce.establishConnection("11", DefaultConnectionConfiguration.getInstance());

I see that the connection is touching the mediator for sure because
I get there output like that:

DEBUG [pool-1-thread-1] 2014-09-24 15:14:21,292 (HandleMessageTask.java:82) - Got message from Socket[addr=/85.178.50.229,port=64861,localport=30303]
DEBUG [pool-1-thread-1] 2014-09-24 15:14:21,295 (DefaultRegisterHandling.java:70) - User 11 added or updated

but on the client side I am getting this:

ERROR [main] 2014-09-24 17:13:16,192 (DeterminingTcpNatMapping.java:134) - Exception eccured while executing test
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
    at java.net.Socket.bind(Socket.java:631)
    at de.fhkn.in.uce.connectivitymanager.investigator.DeterminingTcpNatMapping.executeTestRun(DeterminingTcpNatMapping.java:127)
    at de.fhkn.in.uce.connectivitymanager.investigator.DeterminingTcpNatMapping.executeTestI(DeterminingTcpNatMapping.java:112)
    at de.fhkn.in.uce.connectivitymanager.investigator.DeterminingTcpNatMapping.executeTest(DeterminingTcpNatMapping.java:72)
    at de.fhkn.in.uce.connectivitymanager.investigator.InfrastructureInvestigatorImpl.investigateMappingBehavior(InfrastructureInvestigatorImpl.java:51)
    at de.fhkn.in.uce.connectivitymanager.investigator.InfrastructureInvestigatorImpl.investigateOwnNat(InfrastructureInvestigatorImpl.java:41)
    at de.fhkn.in.uce.connectivitymanager.manager.target.UnsecureTargetSideConnectionEstablishment.register(UnsecureTargetSideConnectionEstablishment.java:82)
    at de.fhkn.in.uce.connectivitymanager.manager.target.UnsecureTargetSideConnectionEstablishment.establishConnection(UnsecureTargetSideConnectionEstablishment.java:63)
    at de.fhkn.in.uce.connectivitymanager.demo.chat.Main.main(Main.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

any idea why does it happens ?

@72Zn
@crusherd

Thanks in advance
Roman

@crusherd
Copy link

Hi Roman,

You are trying to connect an IP and port which is already in use. Please check if any other application is using the given IP and port. Are you executing the application as a Unit test? Do you close the socket(s) when quitting?

Best regrads,
Robert

@romanman
Copy link
Author

not really it was just a straight forward scenario

@crusherd
Copy link

Did you check if there is another application running on the same IP and port because your error is showing this.

@romanman
Copy link
Author

yeah I did, and also checked the other ports ,
it's an internal issue but I can't tell any more
info. I can try some if you will ask me.

@crusherd
Copy link

Did you try it with an UnsecureSourceSideConnectionEstablishment instead of UnsecureTargetSideConnectionEstablishment?
Did you try it like the ConnectivityManager demo to create a UCESocket and then connect? (https://github.com/htwg/UCE#test-the-connectivity-manager-demo)
Sorry, I'm no longer familar with the source code, so it could take a bit longer for a solution. Maybe could @72Zn help.

@superduong
Copy link

Hi Romanman
I have same problem as you. How to fix that ?
Help me !

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

No branches or pull requests

3 participants