Skip to content

Commit 0c1b108

Browse files
committed
add connection options to NetService convenience initializer
1 parent a71ead4 commit 0c1b108

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Sources/SwiftOCA/OCA/Browser.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ extension Ocp1ConnectionFactory {
131131
}
132132

133133
extension Ocp1Connection: Ocp1ConnectionFactory {
134-
public convenience init(_ netService: NetService) async throws {
134+
public convenience init(
135+
_ netService: NetService,
136+
options: Ocp1ConnectionOptions = Ocp1ConnectionOptions()
137+
) async throws {
135138
guard let serviceType = OcaBrowser.ServiceType(rawValue: netService.type) else {
136139
throw Ocp1Error.unknownServiceType
137140
}
@@ -160,15 +163,17 @@ extension Ocp1Connection: Ocp1ConnectionFactory {
160163
await self
161164
.init(
162165
reassigningSelfTo: try Ocp1TCPConnection(
163-
deviceAddress: address
166+
deviceAddress: address,
167+
options: options
164168
) as! Self
165169
)
166170
return
167171
case .udp:
168172
await self
169173
.init(
170174
reassigningSelfTo: try Ocp1UDPConnection(
171-
deviceAddress: address
175+
deviceAddress: address,
176+
options: options
172177
) as! Self
173178
)
174179
return

0 commit comments

Comments
 (0)