[jitsi-dev] [Ice4J] Using ice4J with DTLS (bouncycastle 1.49) - How to connect a DelegatingDatagramSocket ?


#1

Hello,

I'm trying to initiate a DTLS handshake after an ICE negotiation.

My ICE agent has finished its connectivity check, and I have 2 socket made
available by Ice4J using the following code :

LocalCandidate localCandidate = selectedPair.getLocalCandidate();
DatagramSocket localDatagramSocket = localCandidate.getDatagramSocket();
RemoteCandidate remoteCandidate = selectedPair.getRemoteCandidate();
InetSocketAddress remoteSocketAddress = new
InetSocketAddress(remoteCandidate.getTransportAddress().getAddress(),
remoteCandidate.getTransportAddress().getPort());

Using these candidates, I'm trying to set up a DTLS client using
bouncycastle new DTLS implementation (used for negociating an SRTP
handshake, I'm not using a DTLS transport).

In order to initialize bouncycastle, I need to pass in parameter a bound
and connected socket to the DTLS implementation.

I tried to do the following :

localDatagramSocket.connect(remoteSocketAddress)

But nothing happen there (my code hang there for several seconds, then my
remote party terminate the call, due to an expiration timer).

How can I connect my local ICE socket to the remote selected candidate ?

···

--
Pierrick Grasland


#2

Hey Pierrick,

You don't need to call connect. Just start sending packets through the socket.

Cheers,
Emil

···

On 22.07.13, 18:46, Pierrick Grasland wrote:

Hello,

I'm trying to initiate a DTLS handshake after an ICE negotiation.

My ICE agent has finished its connectivity check, and I have 2 socket
made available by Ice4J using the following code :

LocalCandidate localCandidate = selectedPair.getLocalCandidate();
DatagramSocket localDatagramSocket = localCandidate.getDatagramSocket();
RemoteCandidate remoteCandidate = selectedPair.getRemoteCandidate();
InetSocketAddress remoteSocketAddress = new
InetSocketAddress(remoteCandidate.getTransportAddress().getAddress(),
remoteCandidate.getTransportAddress().getPort());

Using these candidates, I'm trying to set up a DTLS client using
bouncycastle new DTLS implementation (used for negociating an SRTP
handshake, I'm not using a DTLS transport).

In order to initialize bouncycastle, I need to pass in parameter a bound
and connected socket to the DTLS implementation.

I tried to do the following :

localDatagramSocket.connect(remoteSocketAddress)

But nothing happen there (my code hang there for several seconds, then
my remote party terminate the call, due to an expiration timer).

How can I connect my local ICE socket to the remote selected candidate ?

--
Pierrick Grasland

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

--
https://jitsi.org