Skip to content

Commit 723b873

Browse files
committed
Specify a listening port in AcceptHelper
1 parent a2f2704 commit 723b873

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

srtgo_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ func TestListen(t *testing.T) {
9999
}
100100
}
101101

102-
func AcceptHelper(numSockets int, options map[string]string, t *testing.T) {
102+
func AcceptHelper(numSockets int, port uint16, options map[string]string, t *testing.T) {
103103
listening := make(chan struct{})
104-
listener := NewSrtSocket("localhost", 8090, options)
104+
listener := NewSrtSocket("localhost", port, options)
105105
var connectors []*SrtSocket
106106
for i := 0; i < numSockets; i++ {
107-
connectors = append(connectors, NewSrtSocket("localhost", 8090, options))
107+
connectors = append(connectors, NewSrtSocket("localhost", port, options))
108108
}
109109
wg := sync.WaitGroup{}
110110
timer := time.AfterFunc(time.Second, func() {
@@ -155,7 +155,7 @@ func TestAcceptNonBlocking(t *testing.T) {
155155

156156
options := make(map[string]string)
157157
options["transtype"] = "file"
158-
AcceptHelper(1, options, t)
158+
AcceptHelper(1, 8091, options, t)
159159
}
160160

161161
func TestAcceptBlocking(t *testing.T) {
@@ -164,15 +164,15 @@ func TestAcceptBlocking(t *testing.T) {
164164
options := make(map[string]string)
165165
options["blocking"] = "1"
166166
options["transtype"] = "file"
167-
AcceptHelper(1, options, t)
167+
AcceptHelper(1, 8092, options, t)
168168
}
169169

170170
func TestMultipleAcceptNonBlocking(t *testing.T) {
171171
InitSRT()
172172

173173
options := make(map[string]string)
174174
options["transtype"] = "file"
175-
AcceptHelper(3, options, t)
175+
AcceptHelper(3, 8093, options, t)
176176
}
177177

178178
func TestMultipleAcceptBlocking(t *testing.T) {
@@ -181,7 +181,7 @@ func TestMultipleAcceptBlocking(t *testing.T) {
181181
options := make(map[string]string)
182182
options["blocking"] = "1"
183183
options["transtype"] = "file"
184-
AcceptHelper(3, options, t)
184+
AcceptHelper(3, 8094, options, t)
185185
}
186186

187187
func TestSetSockOptInt(t *testing.T) {

0 commit comments

Comments
 (0)