[jitsi-users] Ice4J connection Issues


#1

Hi Boris,
  First THANK YOU for the help!

Yes, "terminated" is entered 3 seconds after "completed" and indicates
success.

Looking at the code it SEEMED that the terminated was a thread called three
seconds after, but I had been confused. It is good to know that. I was
confused because I have seen code example in java-bells that seem to act on
"COMPLETED". Does it matter which one I act on to establish the connection?

You haven't included any details, so I cannot say if this is correct or
not. After an Agent completes, you can access the sockets for each of
its Component-s with
component.getSelectedPair().getIceSocketWrapper().

Currently I am accessing the component as follows:

        Component rtpComponent = ims.getComponent(org.ice4j.ice.Component.
RTP);

        Component rtcpComponent = ims.getComponent(org.ice4j.ice.Component.
RTCP);

        CandidatePair rtpPair = rtpComponent.getSelectedPair();

CandidatePair rtcpPair = rtcpComponent.getSelectedPair();

         DatagramSocket dg = rtpPair.getDatagramSocket();

Then I simply store the localsocketaddress and call connect on each socket
with each other's localsocketaddress. It works as an experiment on my local
machine with two different ports.

localDG.connect(dg.getLocalSocketAddress());

I just wanted to make sure that I am doing this correctly. Meaning I am not
breaking the intended ice protocol or something. It seems right, it is
simply new to me.

Assuming this is correct I will try to write something today as a blog to
help others.

Thanks

Regards,
Matthew


#2

Hello,

···

On 12/02/15 15:59, m j wrote:

Hi Boris,
   First THANK YOU for the help!

Yes, "terminated" is entered 3 seconds after "completed" and indicates
success.

Looking at the code it SEEMED that the terminated was a thread called
three seconds after, but I had been confused. It is good to know that. I
was confused because I have seen code example in java-bells that seem to
act on "COMPLETED". Does it matter which one I act on to establish the
connection?

You haven't included any details, so I cannot say if this is correct or
not. After an Agent completes, you can access the sockets for each of
its Component-s with
component.getSelectedPair().getIceSocketWrapper().

Currently I am accessing the component as follows:

         Component rtpComponent =
ims.getComponent(org.ice4j.ice.Component.RTP);

         Component rtcpComponent =
ims.getComponent(org.ice4j.ice.Component.RTCP);

         CandidatePair rtpPair = rtpComponent.getSelectedPair();

CandidatePair rtcpPair = rtcpComponent.getSelectedPair();

         DatagramSocket dg = rtpPair.getDatagramSocket();

Then I simply store the localsocketaddress and call connect on each
socket with each other's localsocketaddress. It works as an experiment
on my local machine with two different ports.

localDG.connect(dg.getLocalSocketAddress());

I just wanted to make sure that I am doing this correctly. Meaning I am
not breaking the intended ice protocol or something. It seems right, it
is simply new to me.

This looks correct to me.

I think you might find this excellent post[1] by Thomas Kuntz useful.

Regards,
Boris

[1] http://blog.sharedmemory.fr/en/2014/06/22/gsoc-2014-ice4j-tutorial/