我正在使用BouncyCastle来实现基于UDP的SSL。我有两个独立的JVM使用UDP相互通信。这些是独立的JVM,而不是任何类型的Web或应用程序容器。
我该如何实现?
我使用过BouncyCastle的测试类但得到例外:
Exception in thread "main" java.net.PortUnreachableException: ICMP Port Unreachable
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:697)
at org.bouncycastle.crypto.tls.UDPTransport.send(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSRecordLayer.sendRecord(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSRecordLayer.send(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake$RecordLayerBuffer.sendToRecordLayer(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.writeHandshakeFragment(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.writeMessage(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.sendMessage(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSServerProtocol.serverHandshake(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSServerProtocol.accept(Unknown Source)
可能的原因是什么?我没有设置任何服务器。