Skip to content

Commit 35a0a8f

Browse files
FIx port problem on test tests.Test.TestConnectSameConnectionMultipleTimesServerDisconnects
1 parent 40e9e27 commit 35a0a8f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/Test.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,13 @@ public void TestConnectWhileAlreadyConnected()
689689

690690
Server server = new Server(apciParameters, parameters);
691691

692-
server.SetLocalPort(20213);
692+
int port = GetPort();
693+
694+
server.SetLocalPort(port);
693695

694696
server.Start();
695697

696-
Connection connection = new Connection("127.0.0.1", 20213, apciParameters, parameters);
698+
Connection connection = new Connection("127.0.0.1", port, apciParameters, parameters);
697699

698700
ConnectionException se = null;
699701

@@ -961,11 +963,11 @@ public void TestConnectSameConnectionMultipleTimes()
961963

962964
Server server = new Server(apciParameters, parameters);
963965

964-
server.SetLocalPort(20213);
966+
server.SetLocalPort(port);
965967

966968
server.Start();
967969

968-
Connection connection = new Connection("127.0.0.1", 20213, apciParameters, parameters);
970+
Connection connection = new Connection("127.0.0.1", port, apciParameters, parameters);
969971

970972
SocketException se = null;
971973

@@ -1011,11 +1013,11 @@ public void TestConnectSameConnectionMultipleTimesServerDisconnects()
10111013

10121014
server.DebugOutput = true;
10131015

1014-
server.SetLocalPort(20213);
1016+
server.SetLocalPort(port);
10151017

10161018
server.Start();
10171019

1018-
Connection connection = new Connection("127.0.0.1", 20213, apciParameters, parameters);
1020+
Connection connection = new Connection("127.0.0.1", port, apciParameters, parameters);
10191021

10201022
connection.DebugOutput = true;
10211023

0 commit comments

Comments
 (0)