Fixes leak of file descriptors by not closing DatagramSockets.

The problem was reproduced with java7 and defining multiple ipv6 fake(not-operational) addresses to one of the interfaces and running for a while.
Fixes jitsi/jitsi-meet#1390 and fixes jitsi/jicofo#167.
This commit is contained in:
damencho 2017-05-10 15:06:15 -05:00
parent e099d4acbe
commit e472f6ac1c
3 changed files with 7 additions and 3 deletions

View File

@ -282,10 +282,10 @@ public class DelegatingDatagramSocket
@Override @Override
public void close() public void close()
{ {
if (delegate == null) if (delegate != null)
super.close();
else
delegate.close(); delegate.close();
super.close();
} }
/** /**

View File

@ -118,6 +118,8 @@ public class MultiplexedDatagramSocket
public void close() public void close()
{ {
multiplexing.close(this); multiplexing.close(this);
super.close();
} }
/** /**

View File

@ -350,6 +350,8 @@ public class RelayedCandidateDatagramSocket
turnCandidateHarvest.hostCandidate.getTransportAddress(), turnCandidateHarvest.hostCandidate.getTransportAddress(),
this); this);
turnCandidateHarvest.close(this); turnCandidateHarvest.close(this);
super.close();
} }
/** /**