Skip to content

Commit

Permalink
only send mandatory keepalive if heartbeat time non-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Jan 27, 2024
1 parent 1aa3930 commit 202d5c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/SwiftOCA/OCP.1/Ocp1Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ open class Ocp1Connection: CustomStringConvertible, ObservableObject {

subscriptions = [:]

// send keepalive to open UDP connection
try await sendKeepAlive()
if heartbeatTime > .zero {
// send keepalive to open UDP connection
try await sendKeepAlive()
}

// refresh all objects
for (_, object) in objects {
Expand Down

0 comments on commit 202d5c1

Please sign in to comment.