NAT problem with smack_310 and jstun-0.7.3

Hi,

I am building a Screen Share application with Smack_3_1_0.

when I run the Demo App with jstun.javawi.de as STUN server, I am getting the following error.

java.net.BindException: Cannot assign requested address
at java.net.PlainDatagramSocketImpl.bind0(Native Method)
at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:82)
at java.net.DatagramSocket.bind(DatagramSocket.java:368)
at java.net.DatagramSocket.(DatagramSocket.java:210)
at java.net.DatagramSocket.(DatagramSocket.java:261)
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:82)
at org.jivesoftware.smackx.jingle.nat.TransportResolver.initializeAndWait(Transpor tResolver.java:387)
at org.jivesoftware.smackx.jingle.nat.ICETransportManager.(ICETransportManag er.java:36)
at Demo.initialize(Demo.java:84)
at Demo.(Demo.java:76)
at Demo.main(Demo.java:176)

This is because we are trying to bind public IP of whichever we got through STUN resolver.

1.Here my question is, why we are binding to the public IP?

I download jstun-0.7.3 and made changes in src/de/javawi/jstun/test/demo/ice/Candidate.java, instead of binding public IP I used local IP, then

this case I am not getting the above error. so please confirm which way of doing is correct.

My actual problem is same as mentioned in this Thread.

I am using jstun.javawi.de and running Demo app from two different public IPs which are behind Port Restricted Cone NAT and Restricted cone NAT.

Once I built jar files from jstun-0.7.3 separately, I am using these jar files in running Demo app.

Here I am able to get the public IP through STUN, but after this the negotiation is not happening.

I am getting error

Terminate Unable to negotiate session. This may be caused by firewall configuration problems.
Session state change: JingleSessionStatePending->JingleSessionStateEnded
Session Ended

Please suggest me a solution for this problem.

even if we have patch for this problem as mentioned in http://www.igniterealtime.org/community/thread/27051

that would be great help to all.

Thanks,

Nandu