Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java')
-rw-r--r--src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java57
1 files changed, 42 insertions, 15 deletions
diff --git a/src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java b/src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java
index f62c5c99..1c053796 100644
--- a/src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java
+++ b/src/main/java/org/bouncycastle/crypto/tls/DTLSTransport.java
@@ -2,53 +2,80 @@ package org.bouncycastle.crypto.tls;
import java.io.IOException;
-public class DTLSTransport implements DatagramTransport {
+public class DTLSTransport
+ implements DatagramTransport
+{
private final DTLSRecordLayer recordLayer;
- DTLSTransport(DTLSRecordLayer recordLayer) {
+ DTLSTransport(DTLSRecordLayer recordLayer)
+ {
this.recordLayer = recordLayer;
}
- public int getReceiveLimit() throws IOException {
+ public int getReceiveLimit()
+ throws IOException
+ {
return recordLayer.getReceiveLimit();
}
- public int getSendLimit() throws IOException {
+ public int getSendLimit()
+ throws IOException
+ {
return recordLayer.getSendLimit();
}
- public int receive(byte[] buf, int off, int len, int waitMillis) throws IOException {
- try {
+ public int receive(byte[] buf, int off, int len, int waitMillis)
+ throws IOException
+ {
+ try
+ {
return recordLayer.receive(buf, off, len, waitMillis);
- } catch (TlsFatalAlert fatalAlert) {
+ }
+ catch (TlsFatalAlert fatalAlert)
+ {
recordLayer.fail(fatalAlert.getAlertDescription());
throw fatalAlert;
- } catch (IOException e) {
+ }
+ catch (IOException e)
+ {
recordLayer.fail(AlertDescription.internal_error);
throw e;
- } catch (RuntimeException e) {
+ }
+ catch (RuntimeException e)
+ {
recordLayer.fail(AlertDescription.internal_error);
throw new TlsFatalAlert(AlertDescription.internal_error);
}
}
- public void send(byte[] buf, int off, int len) throws IOException {
- try {
+ public void send(byte[] buf, int off, int len)
+ throws IOException
+ {
+ try
+ {
recordLayer.send(buf, off, len);
- } catch (TlsFatalAlert fatalAlert) {
+ }
+ catch (TlsFatalAlert fatalAlert)
+ {
recordLayer.fail(fatalAlert.getAlertDescription());
throw fatalAlert;
- } catch (IOException e) {
+ }
+ catch (IOException e)
+ {
recordLayer.fail(AlertDescription.internal_error);
throw e;
- } catch (RuntimeException e) {
+ }
+ catch (RuntimeException e)
+ {
recordLayer.fail(AlertDescription.internal_error);
throw new TlsFatalAlert(AlertDescription.internal_error);
}
}
- public void close() throws IOException {
+ public void close()
+ throws IOException
+ {
recordLayer.close();
}
}