diff options
-rw-r--r-- | lib/installer-exclude/ice4j.jar | bin | 359134 -> 358904 bytes | |||
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java | 51 |
2 files changed, 48 insertions, 3 deletions
diff --git a/lib/installer-exclude/ice4j.jar b/lib/installer-exclude/ice4j.jar Binary files differindex fc587fb..8806069 100644 --- a/lib/installer-exclude/ice4j.jar +++ b/lib/installer-exclude/ice4j.jar diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java index 95fa709..54b6ba6 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.net.*; import org.ice4j.*; +import org.ice4j.stack.*; /** * Represents an application-purposed (as opposed to an ICE-specific) @@ -70,12 +71,56 @@ public class JingleNodesCandidateDatagramSocket extends DatagramSocket int dataOffset = p.getOffset(); /* send to Jingle Nodes relay address on local port */ - DatagramPacket packet = new DatagramPacket(data, dataOffset, dataLen, - new InetSocketAddress(localEndPoint.getAddress(), - localEndPoint.getPort())); + DatagramPacket packet = new DatagramPacket( + data, + dataOffset, + dataLen, + new InetSocketAddress( + localEndPoint.getAddress(), + localEndPoint.getPort())); //XXX reuse an existing DatagramPacket ? super.send(packet); + + // no exception packet is successfully sent, log it + if(StunStack.isPacketLoggerEnabled()) + { + StunStack.getPacketLogger().logPacket( + super.getLocalAddress().getAddress(), + super.getLocalPort(), + packet.getAddress().getAddress(), + packet.getPort(), + packet.getData(), + true); + } + } + + + /** + * Receives a <tt>DatagramPacket</tt> from this socket. The DatagramSocket + * is overridden to log the received packet into the "pcap" (packet capture) + * log. + * + * @param p <tt>DatagramPacket</tt> + * @throws IOException if something goes wrong + */ + @Override + public void receive(DatagramPacket p) + throws IOException + { + super.receive(p); + + // no exception packet is successfully received, log it + if(StunStack.isPacketLoggerEnabled()) + { + StunStack.getPacketLogger().logPacket( + p.getAddress().getAddress(), + p.getPort(), + super.getLocalAddress().getAddress(), + super.getLocalPort(), + p.getData(), + false); + } } /** |