My name is Christoph and i’m a student of computer science at the university of berlin, germany. I’m writing an eclipse plugin for distributed pair programming and use the Smack-API to exchange messages between the users.
I have a problem to use the ICETransportManager to obtain usable ip-adresses for a P2P session. If the machine is behind a NAT-Firewall i get a BindException when creating an instance.
My Code:
ICETransportManager ice = new ICETransportManager(xmppConnection, “stun.xten.net”, 3478);
java.net.BindException: Cannot assign requested address: Cannot bind
at java.net.PlainDatagramSocketImpl.bind0(Native Method)
at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
at java.net.DatagramSocket.bind(Unknown Source)
at java.net.DatagramSocket.(Unknown Source)
at java.net.DatagramSocket.(Unknown Source)
at de.javawi.jstun.test.demo.ice.Candidate.(Candidate.java:44)
at de.javawi.jstun.test.demo.ice.ICENegociator.gatherCandidateAddresses(ICENegocia tor.java:87)
at org.jivesoftware.smackx.jingle.nat.ICEResolver.initialize(ICEResolver.java:81)
at org.jivesoftware.smackx.jingle.nat.TransportResolver.initializeAndWait(Transpor tResolver.java:387)
at org.jivesoftware.smackx.jingle.nat.ICETransportManager.(ICETransportManag er.java:36)
got this error (java.net.BindException: Cannot assign requested address: Cannot bind) in jingle demo on jabber.org and gmail account with different stun servers. Firewall disabled. OS: winXPsp3.
I’m also trying to work with the Jingle implementation in Smack and I’m having the same problem. Can we exchage emails to talk a little more of what may be happening here and keep in touch if we manage to solve the problem and post a solution here.
I finally managed to create a Jingle connection but first I want to see the code you are trying to use and compare it to mine before posting the solution here. I’ve made so many changes in my setup (firewall, server) and code I want to know for sure what was the problem.
Also I would like for you to test my code on your setup and see if it works before posting the solution here.
I am running the demo app on two private networks which are connect to two public address.
These public addresses are one is behind Restricted Cone NAT and another one is behind Port Restricted Cone NAT.
I was able to get the public addresses from STUN, after getting the public IP in jstun code, they are binding this public
in src/de/javawi/jstun/test/demo/ice/Candidate.java which is giving this binding Exception.
could you provide be you code so that i ll test your code on my machine or if you can list out what are the changes you did in jstun or smack code that would be great help to all.
Sorry for not having a reply I still dont have a final solution. I have stumbled with so many problems using smack jingle implementation and openfire.
I think there is defenetly an error in JSTUN lib because if any ipaddress is behind a nat is trying to bind the public ip. I did a ugly fix but still is not enough but now I have read a lot more about the subject and I think I can create a better fix.
Also I didnt understand why it was not using the server as a media relay although the option was on in the server and found the RTPBridge method that checks this was cheking the wrong type in the implementation. I changed that in the source and now the server is creating the RTPBridge. The problem now is for some reason both endpoints are creating rtpbridges instead of one creating it and loking at port A and the other using port B.
I think this week I will have this running and will post the compiled smack-jingle.jar with the changes I’ve made.
Also I changed the JSTUN 0.7.2 to 0.7.3.
Does RTPBridge connection worked for you using the media relay of the server?