Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cf-dev] DTLSConnector Start/Stop

Hi,
  I encountered a strange behavoir with a start/stop method.
I create an endpoint with dynamically assigned port (new InetSocketAddress(InetAddress.getLoopbackAddress(), 0))
  I start it, a port is assigned to it.
  I send request to a server (new DTLS session is established)
  I stop it, then I restart it and a new port is assigned to it.
I try to send a new request to the same server, as the Connection store still contains the connection to this peer, the corresponding established session will be used. But the IP port changed, so at server side there is no connection for this peer, so the Application Data will be ignored by the server ...

I don't know what could be the right fix to this ? I'm not sure to know the purpose of start/stop. In my case that was to simulate a reboot of a device but I suppose recreate a new client should be better to simulate that.
  I suppose we can imagine that :
   a) we clear the ConnectionStore on stop().
b) clean connectionStore at start if the inetAddress changed. (overkill?) c) set resumptionRequired to true for all connection on stop(), to force a session resumption at first communication. b) set resumptionRequired to true for all connection only if the inetAddress changed ( overoverkill ??)

I'm not sure there is another use case than testing for start/stop, so I suppose the a) is enough ?

Simon


Back to the top