diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-03-22 23:43:22 +1030 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-03-22 23:43:22 +1030 |
commit | bb077227fa263bed86980f8cc6aa6d4631c5010e (patch) | |
tree | 670bbf9bfe2ef73d7e73187fc3fe2072d1871f4a /crypto | |
parent | Records with ContentType.heartbeat should give 'unexpected_message' (diff) | |
download | BouncyCastle.NET-ed25519-bb077227fa263bed86980f8cc6aa6d4631c5010e.tar.xz |
Stop TcpListener in TlsServerTest
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/test/src/crypto/tls/test/TlsServerTest.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/crypto/test/src/crypto/tls/test/TlsServerTest.cs b/crypto/test/src/crypto/tls/test/TlsServerTest.cs index 77adf22f7..7920cb59a 100644 --- a/crypto/test/src/crypto/tls/test/TlsServerTest.cs +++ b/crypto/test/src/crypto/tls/test/TlsServerTest.cs @@ -26,14 +26,21 @@ namespace Org.BouncyCastle.Crypto.Tls.Tests TcpListener ss = new TcpListener(IPAddress.Any, port); ss.Start(); Stream stdout = Console.OpenStandardOutput(); - while (true) + try { - TcpClient s = ss.AcceptTcpClient(); - Console.WriteLine("--------------------------------------------------------------------------------"); - Console.WriteLine("Accepted " + s); - ServerThread st = new ServerThread(s, stdout); - Thread t = new Thread(new ThreadStart(st.Run)); - t.Start(); + while (true) + { + TcpClient s = ss.AcceptTcpClient(); + Console.WriteLine("--------------------------------------------------------------------------------"); + Console.WriteLine("Accepted " + s); + ServerThread st = new ServerThread(s, stdout); + Thread t = new Thread(new ThreadStart(st.Run)); + t.Start(); + } + } + finally + { + ss.Stop(); } } |